From 8dc8efae4f3a2bee21325e86bbcab7fab75b1f54 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Fri, 14 Jul 2023 19:20:32 +0000 Subject: [PATCH 01/33] Added bug report --- .github/ISSUE_TEMPLATE/bug-report.yml | 78 +++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 000000000..79b48d408 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,78 @@ +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: | + - [x] Bug + + 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. + + Please provide the following details about your environment. 🚨 *If this section is ignored, your submission will be flagged as **incomplete** & automatically closed.* + + Please specify what version of PnPjs library you are using +- 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: + - 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: Expected or Desired Behavior + description: Describe what you are trying to accomplish. + value: | + I'm trying to get items from a list in a site. +- type: textarea + attributes: + label: Observed Behavior + description: Describe the results you're getting. + value: | + I'm getting an empty response +- 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. + value: | + 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); + ``` \ No newline at end of file From fe0f544e5f76017079c0c89925db8de0214e7bf0 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Fri, 14 Jul 2023 19:21:29 +0000 Subject: [PATCH 02/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 79b48d408..fb11cfacc 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,6 +1,6 @@ name: 🐞 Bug or Error Report description: Submit a bug or error report. -labels: ['type: something isn't working', 'status: investigate'] +labels: ["type: something isn't working", "status: investigate"] body: - type: markdown @@ -75,4 +75,4 @@ body: // get all the items from a list const items: any[] = await sp.web.lists.getByTitle("My List").items(); console.log(items); - ``` \ No newline at end of file + ``` From f4e4458016159a66fb83f4229d877325117f8f44 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Fri, 14 Jul 2023 19:24:48 +0000 Subject: [PATCH 03/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index fb11cfacc..69fd1b6cf 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -28,13 +28,13 @@ body: 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 + 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 From c149a935e4127e705a6f15538b606a0f3acdb214 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Fri, 14 Jul 2023 19:27:15 +0000 Subject: [PATCH 04/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 69fd1b6cf..d86af624b 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -25,14 +25,14 @@ body: - 3.x - 2.x (No longer supported) - 1.x (No longer supported) - validations: - required: true + 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 + placeholder: '1.0' validations: required: true - type: dropdown @@ -43,8 +43,8 @@ body: - NodeJS - Browser App (Hosted external to Microsoft 365 platform) - other (enter in the "Additional environment details" area below) - validations: - required: true + validations: + required: true - type: textarea attributes: label: Expected or Desired Behavior From 7be908008c0b13a62143bcbff8693e8f1da89343 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Fri, 14 Jul 2023 19:31:39 +0000 Subject: [PATCH 05/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index d86af624b..bab85cd9b 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -16,7 +16,7 @@ body: Please provide the following details about your environment. 🚨 *If this section is ignored, your submission will be flagged as **incomplete** & automatically closed.* - Please specify what version of PnPjs library you are using + ##Please specify what version of PnPjs library you are using - type: dropdown attributes: label: Major Version From 9e611e50ce1105d9e7324c8a9790cca320cac4ee Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Fri, 14 Jul 2023 19:31:53 +0000 Subject: [PATCH 06/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index bab85cd9b..e28121dbc 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -16,7 +16,7 @@ body: Please provide the following details about your environment. 🚨 *If this section is ignored, your submission will be flagged as **incomplete** & automatically closed.* - ##Please specify what version of PnPjs library you are using + ## Please specify what version of PnPjs library you are using - type: dropdown attributes: label: Major Version From ae4491a215485bb35b5efdb182da41a994cea4da Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Fri, 14 Jul 2023 19:32:10 +0000 Subject: [PATCH 07/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index e28121dbc..3721fa66f 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -16,7 +16,7 @@ body: Please provide the following details about your environment. 🚨 *If this section is ignored, your submission will be flagged as **incomplete** & automatically closed.* - ## Please specify what version of PnPjs library you are using + ### Please specify what version of PnPjs library you are using - type: dropdown attributes: label: Major Version From b44367005fd455b67c99bf71cde1850eba6a1bb2 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Fri, 14 Jul 2023 19:34:15 +0000 Subject: [PATCH 08/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 3721fa66f..45d5e227c 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -45,6 +45,12 @@ body: - 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. + value: | + I'm using NodeJS and certificate based MSAL for authentication. - type: textarea attributes: label: Expected or Desired Behavior From 21c5ae470fe8419547c45fd5198b892f833b89f1 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Fri, 14 Jul 2023 19:48:55 +0000 Subject: [PATCH 09/33] added enhancements and questions --- .github/ISSUE_TEMPLATE/enhancement.yml | 52 +++++++++++++++++++ .github/ISSUE_TEMPLATE/question.yml | 69 ++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/enhancement.yml create mode 100644 .github/ISSUE_TEMPLATE/question.yml diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml new file mode 100644 index 000000000..696c2dc9b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement.yml @@ -0,0 +1,52 @@ +name: 🏗 Enhancement +description: Suggest an enhancement +labels: ["type: enhancement", "status: investigate"] + +body: +- type: markdown + attributes: + value: | + - [x] Enhancement + + 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. + value: | + 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. + value: | + 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); + ``` diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 000000000..6f970cca5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,69 @@ +name: ❓ Question/Assistance Needed +description: Ask a question or seek guidance +labels: ["type: question", "help wanted 🐇"] + +body: +- type: markdown + attributes: + value: | + - [x] Question + + This issue type is for asking questions or requesting assistance in using the library. Please provide as much information as possible so a member of the community can best assist you. 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: What version of PnPjs library you are using + options: + - 4.x + - 3.x + - 2.x (No longer supported) + - 1.x (No longer supported) + validations: + required: false +- 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: false +- type: dropdown + attributes: + label: Target environment + options: + - 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. + value: | + I'm using NodeJS and certificate based MSAL for authentication. +- type: textarea + attributes: + label: Question/Request + 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. + value: | + 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); + ``` From fdd270389540eee9ac8b6178c08d84abd0e703f6 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 14:46:05 +0000 Subject: [PATCH 10/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 45d5e227c..f17f9e202 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -48,9 +48,7 @@ body: - type: textarea attributes: label: Additional environment details - description: Please describe the environment you're working in and how you're authenticating. - value: | - I'm using NodeJS and certificate based MSAL for authentication. + description: Please describe the environment you're working in and how you're authenticating. (e.g I'm using NodeJS and certificate based MSAL for authentication.) - type: textarea attributes: label: Expected or Desired Behavior From 4d44c8663d10e4644a94d614e7fbacbd772161bc Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 14:49:44 +0000 Subject: [PATCH 11/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index f17f9e202..a9c56f7e8 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -61,12 +61,11 @@ body: description: Describe the results you're getting. value: | I'm getting an empty response -- type: textarea +- type: markdown 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. value: | - Here is the code I'm running + ## Sample + Here is the code I'm running ```TypeScript import { spfi } from "@pnp/sp"; @@ -80,3 +79,8 @@ body: const items: any[] = await sp.web.lists.getByTitle("My List").items(); console.log(items); ``` +- 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. + From 94c8bd759b2012533d1f4ebd34c3c3fdb2427418 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 14:51:02 +0000 Subject: [PATCH 12/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index a9c56f7e8..dbf0dbd92 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -61,10 +61,14 @@ body: description: Describe the results you're getting. value: | I'm getting an empty response +- 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. - type: markdown attributes: value: | - ## Sample + ### Steps to Reproduce: Sample Here is the code I'm running ```TypeScript @@ -79,8 +83,4 @@ body: const items: any[] = await sp.web.lists.getByTitle("My List").items(); console.log(items); ``` -- 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. From a25ae4c10abc1d2dc3ef1677612566c9a24854b4 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 14:51:40 +0000 Subject: [PATCH 13/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index dbf0dbd92..d30ad4401 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -68,7 +68,7 @@ body: - type: markdown attributes: value: | - ### Steps to Reproduce: Sample + **Steps to Reproduce: Sample** Here is the code I'm running ```TypeScript From 3b725f5659fdc0876edc8939132dd1b1783db886 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 14:53:02 +0000 Subject: [PATCH 14/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index d30ad4401..9afc0f009 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -59,7 +59,7 @@ body: attributes: label: Observed Behavior description: Describe the results you're getting. - value: | + placerholder: | I'm getting an empty response - type: textarea attributes: From f0ed20b9dccc3e627c073f4650205510c511cb1b Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 14:53:41 +0000 Subject: [PATCH 15/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 9afc0f009..bdae53681 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -59,7 +59,7 @@ body: attributes: label: Observed Behavior description: Describe the results you're getting. - placerholder: | + placeholder: | I'm getting an empty response - type: textarea attributes: From cbf04da86d3c034259f97ed4ccbfc1b17c3d2b00 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 14:54:24 +0000 Subject: [PATCH 16/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index bdae53681..4d69aff0f 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -61,6 +61,8 @@ body: description: Describe the results you're getting. placeholder: | I'm getting an empty response + validations: + required: true - type: textarea attributes: label: Steps to Reproduce From 84a210f3f9ab9251648a1b63bc54635eb08c133c Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 14:55:29 +0000 Subject: [PATCH 17/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 4d69aff0f..e88a15180 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -67,11 +67,8 @@ body: 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. -- type: markdown - attributes: - value: | - **Steps to Reproduce: Sample** - Here is the code I'm running + placeholder: | + Here is the code I'm running ```TypeScript import { spfi } from "@pnp/sp"; @@ -84,5 +81,8 @@ body: // get all the items from a list const items: any[] = await sp.web.lists.getByTitle("My List").items(); console.log(items); - ``` + ``` + validations: + required: true + From c4bd51087fb1f19e0ba466f7dc2aca66c28b2ccf Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 15:01:11 +0000 Subject: [PATCH 18/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index e88a15180..3bf95f9fa 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -17,6 +17,16 @@ body: Please provide the following details about your environment. 🚨 *If this section is ignored, your submission will be flagged as **incomplete** & automatically closed.* ### Please specify what version of PnPjs library you are using +- type: checkbox + attributes: + label: Issue Type + options: + - Bug + - Enhancement + - Question + value: Bug + validations: + required: true - type: dropdown attributes: label: Major Version From 98acfe2ef07ea56bc958de4fb07935939c0b58b1 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 15:05:32 +0000 Subject: [PATCH 19/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 3bf95f9fa..4656b067a 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -6,8 +6,6 @@ body: - type: markdown attributes: value: | - - [x] Bug - 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). @@ -17,16 +15,6 @@ body: Please provide the following details about your environment. 🚨 *If this section is ignored, your submission will be flagged as **incomplete** & automatically closed.* ### Please specify what version of PnPjs library you are using -- type: checkbox - attributes: - label: Issue Type - options: - - Bug - - Enhancement - - Question - value: Bug - validations: - required: true - type: dropdown attributes: label: Major Version From e1b1e7de83dfdce15dcbd9f4bba66dc03710754f Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 18:26:27 +0000 Subject: [PATCH 20/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 4656b067a..42e937b17 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -11,10 +11,6 @@ body: - 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. - - Please provide the following details about your environment. 🚨 *If this section is ignored, your submission will be flagged as **incomplete** & automatically closed.* - - ### Please specify what version of PnPjs library you are using - type: dropdown attributes: label: Major Version @@ -46,13 +42,19 @@ body: - type: textarea attributes: label: Additional environment details - description: Please describe the environment you're working in and how you're authenticating. (e.g I'm using NodeJS and certificate based MSAL for authentication.) + 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. - value: | + placeholder: | I'm trying to get items from a list in a site. + validations: + required: true - type: textarea attributes: label: Observed Behavior From 525ad2c5670548550b08742e441514580c71812e Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 18:35:16 +0000 Subject: [PATCH 21/33] Update enhancement.yml --- .github/ISSUE_TEMPLATE/enhancement.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml index 696c2dc9b..93243c902 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.yml +++ b/.github/ISSUE_TEMPLATE/enhancement.yml @@ -6,14 +6,11 @@ body: - type: markdown attributes: value: | - - [x] Enhancement - 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 @@ -29,13 +26,13 @@ body: attributes: label: Additional environment details description: Please describe the environment you're working in and how you're authenticating. - value: | + 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. - value: | + 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 From eb905fd43ae494badc8c217034803274d2ad91dd Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 18:35:44 +0000 Subject: [PATCH 22/33] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 42e937b17..4f1a53a93 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -33,6 +33,7 @@ body: attributes: label: Target environment options: + - All - SharePoint Framework - NodeJS - Browser App (Hosted external to Microsoft 365 platform) From a14a26a947955f04afb2e3939761c123da35d6bd Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 18:37:10 +0000 Subject: [PATCH 23/33] Update question.yml --- .github/ISSUE_TEMPLATE/question.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 6f970cca5..58aca6ddb 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -6,14 +6,11 @@ body: - type: markdown attributes: value: | - - [x] Question - This issue type is for asking questions or requesting assistance in using the library. Please provide as much information as possible so a member of the community can best assist you. 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: What version of PnPjs library you are using @@ -23,7 +20,7 @@ body: - 2.x (No longer supported) - 1.x (No longer supported) validations: - required: false + required: true - type: input id: minorver attributes: @@ -31,11 +28,12 @@ body: description: Include the minor and patch version numbers, e.g. for 4.1.0 placeholder: '1.0' validations: - required: false + required: true - type: dropdown attributes: label: Target environment options: + - All - SharePoint Framework - NodeJS - Browser App (Hosted external to Microsoft 365 platform) @@ -46,13 +44,15 @@ body: attributes: label: Additional environment details description: Please describe the environment you're working in and how you're authenticating. - value: | + placeholder: | I'm using NodeJS and certificate based MSAL for authentication. + validations: + required: true - type: textarea attributes: label: Question/Request 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. - value: | + 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 @@ -66,4 +66,6 @@ body: // get all the items from a list const items: any[] = await sp.web.lists.getByTitle("My List").items(); console.log(items); + validations: + required: true ``` From e6ecaf21c1613d4519dfdd61528690e250154311 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 24 Jul 2023 18:38:21 +0000 Subject: [PATCH 24/33] Update question.yml --- .github/ISSUE_TEMPLATE/question.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 58aca6ddb..139c787fc 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -66,6 +66,6 @@ body: // get all the items from a list const items: any[] = await sp.web.lists.getByTitle("My List").items(); console.log(items); + ``` validations: required: true - ``` From 6cca606b85dc0c49941f442b69bb3ec5aefc93f4 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Tue, 8 Aug 2023 22:07:17 +0000 Subject: [PATCH 25/33] WIP --- docs/graph/analytics.md | 58 ++++++++ docs/graph/{onedrive.md => drive.md} | 96 +++++-------- docs/graph/shares.md | 2 +- docs/graph/users.md | 2 +- packages/graph/analytics/driveItems.ts | 15 ++ packages/graph/analytics/index.ts | 7 + packages/graph/analytics/listItems.ts | 15 ++ packages/graph/analytics/sites.ts | 16 +++ packages/graph/analytics/types.ts | 12 ++ packages/graph/{onedrive => drive}/funcs.ts | 0 packages/graph/{onedrive => drive}/groups.ts | 0 packages/graph/{onedrive => drive}/index.ts | 1 - packages/graph/{onedrive => drive}/sites.ts | 0 packages/graph/{onedrive => drive}/types.ts | 16 +-- packages/graph/{onedrive => drive}/users.ts | 0 packages/graph/list-item/index.ts | 9 ++ packages/graph/list-item/list.ts | 14 ++ packages/graph/list-item/types.ts | 55 ++++++++ packages/graph/lists/drive.ts | 4 +- packages/graph/lists/types.ts | 10 +- packages/graph/mail/funcs.ts | 20 +++ packages/graph/mail/groups.ts | 0 packages/graph/mail/index.ts | 5 + packages/graph/mail/types.ts | 0 packages/graph/mail/users.ts | 20 +++ packages/graph/presets/all.ts | 4 +- packages/graph/shares/types.ts | 2 +- test/graph/analytics.ts | 137 +++++++++++++++++++ test/graph/{onedrive.ts => drive.ts} | 18 +-- test/graph/lists.ts | 2 +- test/graph/querable.ts | 2 +- 31 files changed, 437 insertions(+), 105 deletions(-) create mode 100644 docs/graph/analytics.md rename docs/graph/{onedrive.md => drive.md} (88%) create mode 100644 packages/graph/analytics/driveItems.ts create mode 100644 packages/graph/analytics/index.ts create mode 100644 packages/graph/analytics/listItems.ts create mode 100644 packages/graph/analytics/sites.ts create mode 100644 packages/graph/analytics/types.ts rename packages/graph/{onedrive => drive}/funcs.ts (100%) rename packages/graph/{onedrive => drive}/groups.ts (100%) rename packages/graph/{onedrive => drive}/index.ts (97%) rename packages/graph/{onedrive => drive}/sites.ts (100%) rename packages/graph/{onedrive => drive}/types.ts (95%) rename packages/graph/{onedrive => drive}/users.ts (100%) create mode 100644 packages/graph/list-item/index.ts create mode 100644 packages/graph/list-item/list.ts create mode 100644 packages/graph/list-item/types.ts create mode 100644 packages/graph/mail/funcs.ts create mode 100644 packages/graph/mail/groups.ts create mode 100644 packages/graph/mail/index.ts create mode 100644 packages/graph/mail/types.ts create mode 100644 packages/graph/mail/users.ts create mode 100644 test/graph/analytics.ts rename test/graph/{onedrive.ts => drive.ts} (94%) diff --git a/docs/graph/analytics.md b/docs/graph/analytics.md new file mode 100644 index 000000000..e6ed76af0 --- /dev/null +++ b/docs/graph/analytics.md @@ -0,0 +1,58 @@ +# @pnp/graph/analytics + +The ability to get analytics for OneDrive and SharePoint drive items, SharePoint sites, and SharePoint list items. + +## IInvitations + +[![Invokable Banner](https://img.shields.io/badge/Invokable-informational.svg)](../concepts/invokable.md) [![Selective Imports Banner](https://img.shields.io/badge/Selective%20Imports-informational.svg)](../concepts/selective-imports.md) + +## Get Drive Item Analytics + +Using analytics() you get the Item Analytics for a Drive Item + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/users"; +import "@pnp/graph/drive"; +import "@pnp/graph/analytics"; +import { IAnalyticsOptions } from "@pnp/graph/analytics"; + +const graph = graphfi(...); + +// Defaults to lastSevenDays +const analytics = await graph.users.getById("user@tenant.onmicrosoft.com").drives.getById("{drive id}").items.getById("{item id}").analytics()(); + +const analytics = await graph.me.drives.getById("{drive id}").items.getById("{item id}").analytics()(); + +// Get analytics for all time +const analyticOptions: IAnalyticsOptions = { + timeRange: "allTime" +}; + +const analyticsAllTime = await graph.me.drives.getById("{drive id}").items.getById("{item id}").analytics(analyticOptions)(); +``` + +## Get Site Analytics + +Using analytics() you can get the analytics for a SharePoint site + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; +import "@pnp/graph/analytics"; +import { IAnalyticsOptions } from "@pnp/graph/analytics"; + +const graph = graphfi(...); + +const site = this.pnp.graph.sites.getById(this.pnp.settings.graph.id); + +// Defaults to lastSevenDays +const analytics = await site.analytics(); + +// Get analytics for all time +const analyticOptions: IAnalyticsOptions = { + timeRange: "allTime" +}; + +const analyticsAllTime = await site.analytics(analyticOptions); +``` diff --git a/docs/graph/onedrive.md b/docs/graph/drive.md similarity index 88% rename from docs/graph/onedrive.md rename to docs/graph/drive.md index fb4f968ad..612d39ff0 100644 --- a/docs/graph/onedrive.md +++ b/docs/graph/drive.md @@ -1,7 +1,7 @@ -# @pnp/graph/onedrive +# @pnp/graph/drive -The ability to manage drives and drive items in Onedrive is a capability introduced in version 1.2.4 of @pnp/graph. Through the methods described -you can manage drives and drive items in Onedrive. +The ability to manage drives and drive items in OneDrive and SharePoint is a capability introduced in version 1.2.4 of @pnp/graph. Through the methods described +you can manage drives and drive items in OneDrive and SharePoint. ## IInvitations @@ -9,14 +9,14 @@ you can manage drives and drive items in Onedrive. ## Get the default drive -Using the drive you can get the users default drive from Onedrive, or the groups or sites default document library. +Using the drive you can get the users default drive from OneDrive, or the groups or sites default document library. ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; import "@pnp/graph/groups"; import "@pnp/graph/sites"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -31,14 +31,14 @@ const siteDrive = await graph.sites.getById("{site identifier}").drive(); ## Get all of the drives -Using the drives() you can get the users available drives from Onedrive +Using the drives() you can get the users available drives from OneDrive ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; import "@pnp/graph/groups"; import "@pnp/graph/sites"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -59,7 +59,7 @@ Using the drives.getById() you can get one of the available drives in Outlook ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -78,7 +78,7 @@ Using the list() you get the associated list information ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -94,7 +94,7 @@ Form more infomration about acting on the IList object see [@pnpjs/graph/lists]( ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; import "@pnp/graph/lists"; const graph = graphfi(...); @@ -113,7 +113,7 @@ Using the recent() you get the recent files ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -130,7 +130,7 @@ Using the sharedWithMe() you get the files shared with the user ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -152,7 +152,7 @@ List the items that have been followed by the signed in user. ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -169,7 +169,7 @@ import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; import "@pnp/graph/sites"; import "@pnp/graph/groups"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -194,7 +194,7 @@ Using the children() you get the children ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -215,7 +215,7 @@ Using the drive.getItemsByPath() you can get the contents of a particular folder ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -231,9 +231,9 @@ Using the add you can add an item, for more options please user the upload metho ```TypeScript import { graphfi } from "@pnp/graph"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; import "@pnp/graph/users"; -import {IDriveItemAddResult} from "@pnp/graph/onedrive"; +import {IDriveItemAddResult} from "@pnp/graph/drive"; const graph = graphfi(...); @@ -247,9 +247,9 @@ Using the .upload method you can add or update the content of an item. ```TypeScript import { graphfi } from "@pnp/graph"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; import "@pnp/graph/users"; -import {IFileOptions, IDriveItemAddResult} from "@pnp/graph/onedrive"; +import {IFileOptions, IDriveItemAddResult} from "@pnp/graph/drive"; const graph = graphfi(...); @@ -282,7 +282,7 @@ Using addFolder you can add a folder ```TypeScript import { graph } from "@pnp/graph"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; import "@pnp/graph/users" import {IDriveItemAddResult} from "@pnp/graph/ondrive"; @@ -300,7 +300,7 @@ Using the search() you can search for items, and optionally select properties ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -320,7 +320,7 @@ Using the items.getById() you can get a specific item from the current drive ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -337,7 +337,7 @@ Using the drive.getItemByPath() you can get a specific item from the current dri ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -354,7 +354,7 @@ Using the item.getContent() you can get the content of a file. ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -385,7 +385,7 @@ Using the item.convertContent() you can get a PDF version of the file. See [offi ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -414,7 +414,7 @@ Using the thumbnails() you get the thumbnails ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -431,7 +431,7 @@ Using the delete() you delete the current item ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -448,7 +448,7 @@ Using the update() you update the current item ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -465,7 +465,7 @@ Using the move() you move the current item, and optionally update it ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -491,7 +491,7 @@ Using the copy() you can copy the current item to a new location, returns the pa ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; const graph = graphfi(...); @@ -517,8 +517,8 @@ Using the users default drive you can get special folders, including: Documents, ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; -import { SpecialFolder, IDriveItem } from "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; +import { SpecialFolder, IDriveItem } from "@pnp/graph/drive"; const graph = graphfi(...); @@ -540,8 +540,8 @@ If you want to obtain long-lived embeddable links, use the createLink API instea ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; -import { IPreviewOptions, IDriveItemPreviewInfo } from "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; +import { IPreviewOptions, IDriveItemPreviewInfo } from "@pnp/graph/drive"; import { ItemPreviewInfo } from "@microsoft/microsoft-graph-types" const graph = graphfi(...); @@ -566,7 +566,7 @@ Track changes in a driveItem and its children over time. ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; import { IDeltaItems } from "@pnp/graph/ondrive"; const graph = graphfi(...); @@ -588,27 +588,3 @@ for await (const val of delta.next.top(20).paged()) { console.log(JSON.stringify(val, null, 2)); } ``` - -## Get Drive Item Analytics - -Using the analytics() you get the ItemAnalytics for a DriveItem - -```TypeScript -import { graphfi } from "@pnp/graph"; -import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; -import { IAnalyticsOptions } from "@pnp/graph/onedrive"; - -const graph = graphfi(...); - -// Defaults to lastSevenDays -const analytics = await graph.users.getById("user@tenant.onmicrosoft.com").drives.getById("{drive id}").items.getById("{item id}").analytics()(); - -const analytics = await graph.me.drives.getById("{drive id}").items.getById("{item id}").analytics()(); - -const analyticOptions: IAnalyticsOptions = { - timeRange: "allTime" -}; - -const analyticsAllTime = await graph.me.drives.getById("{drive id}").items.getById("{item id}").analytics(analyticOptions)(); -``` diff --git a/docs/graph/shares.md b/docs/graph/shares.md index c2b13040a..c5fd39684 100644 --- a/docs/graph/shares.md +++ b/docs/graph/shares.md @@ -32,7 +32,7 @@ const shareInfo = await graph.shares.getById(shareLink)(); ## Access a Share's driveItem resource -You can also access the full functionality of the driveItem via a share. Find [more details on the capabilities of driveItem here](./onedrive.md). +You can also access the full functionality of the driveItem via a share. Find [more details on the capabilities of driveItem here](./drive.md). ```TS import { graphfi } from "@pnp/graph"; diff --git a/docs/graph/users.md b/docs/graph/users.md index 8b8a0aae2..fff64cc35 100644 --- a/docs/graph/users.md +++ b/docs/graph/users.md @@ -131,4 +131,4 @@ See [Messages](./messages.md) ## User OneDrive -See [OneDrive](./onedrive.md) +See [Drive](./drive.md) diff --git a/packages/graph/analytics/driveItems.ts b/packages/graph/analytics/driveItems.ts new file mode 100644 index 000000000..ca4ef9e6f --- /dev/null +++ b/packages/graph/analytics/driveItems.ts @@ -0,0 +1,15 @@ +import { _DriveItem } from "../drive/types.js"; +import { IAnalyticsOptions, analytics } from "./types.js"; +import { ItemAnalytics as IItemAnalytics } from "@microsoft/microsoft-graph-types"; + +declare module "../drive/types" { + interface _DriveItem { + analytics(analyticsOptions?: IAnalyticsOptions): Promise; + } + + interface DriveItem { + analytics(analyticsOptions?: IAnalyticsOptions): Promise; + } +} + +_DriveItem.prototype.analytics = analytics; diff --git a/packages/graph/analytics/index.ts b/packages/graph/analytics/index.ts new file mode 100644 index 000000000..6f00c89a7 --- /dev/null +++ b/packages/graph/analytics/index.ts @@ -0,0 +1,7 @@ +import "./driveItems.js"; +import "./listItems.js"; +import "./sites.js"; + +export { + IAnalyticsOptions, +} from "./types.js"; diff --git a/packages/graph/analytics/listItems.ts b/packages/graph/analytics/listItems.ts new file mode 100644 index 000000000..1b3f56ff9 --- /dev/null +++ b/packages/graph/analytics/listItems.ts @@ -0,0 +1,15 @@ +import { _ListItem } from "../list-item/types.js"; +import { IAnalyticsOptions, analytics } from "./types.js"; +import { ItemAnalytics as IItemAnalytics } from "@microsoft/microsoft-graph-types"; + +declare module "../list-item/types" { + interface _ListItem { + analytics(analyticsOptions?: IAnalyticsOptions): Promise; + } + + interface ListItem { + analytics(analyticsOptions?: IAnalyticsOptions): Promise; + } +} + +_ListItem.prototype.analytics = analytics; diff --git a/packages/graph/analytics/sites.ts b/packages/graph/analytics/sites.ts new file mode 100644 index 000000000..0b6346508 --- /dev/null +++ b/packages/graph/analytics/sites.ts @@ -0,0 +1,16 @@ +import { _Site } from "../sites/types.js"; +import { IAnalyticsOptions, analytics } from "./types.js"; +import { ItemAnalytics as IItemAnalytics } from "@microsoft/microsoft-graph-types"; + + +declare module "../sites/types" { + interface _Site { + analytics(analyticsOptions?: IAnalyticsOptions): Promise; + } + + interface ISite { + analytics(analyticsOptions?: IAnalyticsOptions): Promise; + } +} + +_Site.prototype.analytics = analytics; diff --git a/packages/graph/analytics/types.ts b/packages/graph/analytics/types.ts new file mode 100644 index 000000000..dc2cdffd7 --- /dev/null +++ b/packages/graph/analytics/types.ts @@ -0,0 +1,12 @@ +import { ItemAnalytics as IItemAnalytics } from "@microsoft/microsoft-graph-types"; +import { graphGet } from "../operations.js"; +import { GraphQueryable } from "../graphqueryable.js"; + +export interface IAnalyticsOptions { + timeRange: "allTime" | "lastSevenDays"; +} + +export function analytics(analyticsOptions?: IAnalyticsOptions): Promise { + const query = `analytics/${analyticsOptions ? analyticsOptions.timeRange : "lastSevenDays"}`; + return graphGet(GraphQueryable(this, query)); +} diff --git a/packages/graph/onedrive/funcs.ts b/packages/graph/drive/funcs.ts similarity index 100% rename from packages/graph/onedrive/funcs.ts rename to packages/graph/drive/funcs.ts diff --git a/packages/graph/onedrive/groups.ts b/packages/graph/drive/groups.ts similarity index 100% rename from packages/graph/onedrive/groups.ts rename to packages/graph/drive/groups.ts diff --git a/packages/graph/onedrive/index.ts b/packages/graph/drive/index.ts similarity index 97% rename from packages/graph/onedrive/index.ts rename to packages/graph/drive/index.ts index 7e46ed940..21157d418 100644 --- a/packages/graph/onedrive/index.ts +++ b/packages/graph/drive/index.ts @@ -30,7 +30,6 @@ export { IDeltaItems, IPreviewOptions, IFileOptions, - IAnalyticsOptions, } from "./types.js"; declare module "../fi" { diff --git a/packages/graph/onedrive/sites.ts b/packages/graph/drive/sites.ts similarity index 100% rename from packages/graph/onedrive/sites.ts rename to packages/graph/drive/sites.ts diff --git a/packages/graph/onedrive/types.ts b/packages/graph/drive/types.ts similarity index 95% rename from packages/graph/onedrive/types.ts rename to packages/graph/drive/types.ts index deb0e0b35..11abdf1d1 100644 --- a/packages/graph/onedrive/types.ts +++ b/packages/graph/drive/types.ts @@ -8,7 +8,7 @@ import { graphInvokableFactory, GraphQueryable, } from "../graphqueryable.js"; -import { Drive as IDriveType, DriveItem as IDriveItemType, ItemPreviewInfo as IDriveItemPreviewInfo, ItemAnalytics as IItemAnalytics } from "@microsoft/microsoft-graph-types"; +import { Drive as IDriveType, DriveItem as IDriveItemType, ItemPreviewInfo as IDriveItemPreviewInfo } from "@microsoft/microsoft-graph-types"; import { combine } from "@pnp/core"; import { defaultPath, getById, IGetById, deleteable, IDeleteable, updateable, IUpdateable } from "../decorators.js"; import { body, BlobParse, CacheNever, errorCheck, InjectHeaders } from "@pnp/queryable"; @@ -344,16 +344,6 @@ export class _DriveItem extends _GraphQueryableInstance { public async preview(previewOptions?: IPreviewOptions): Promise { return graphPost(DriveItem(this, "preview"), body(previewOptions)); } - - /** - * Method for getting item analytics. Defaults to lastSevenDays. - * @param analyticsOptions - IAnalyticsOptions (Optional) - * @returns IGraphQueryableCollection - */ - public analytics(analyticsOptions?: IAnalyticsOptions): IGraphQueryableCollection { - const query = `analytics/${analyticsOptions ? analyticsOptions.timeRange : "lastSevenDays"}`; - return >GraphQueryableCollection(this, query); - } } export interface IDriveItem extends _DriveItem, IDeleteable, IUpdateable { } export const DriveItem = graphInvokableFactory(_DriveItem); @@ -476,7 +466,3 @@ export interface IDeltaItems { delta: IGraphQueryableCollection; values: any[]; } - -export interface IAnalyticsOptions { - timeRange: "allTime" | "lastSevenDays"; -} diff --git a/packages/graph/onedrive/users.ts b/packages/graph/drive/users.ts similarity index 100% rename from packages/graph/onedrive/users.ts rename to packages/graph/drive/users.ts diff --git a/packages/graph/list-item/index.ts b/packages/graph/list-item/index.ts new file mode 100644 index 000000000..86195c15b --- /dev/null +++ b/packages/graph/list-item/index.ts @@ -0,0 +1,9 @@ +import "./list.js"; + +export { + ListItems, + IListItems, + ListItem, + IListItem, + IListItemAddResult, +} from "./types.js"; diff --git a/packages/graph/list-item/list.ts b/packages/graph/list-item/list.ts new file mode 100644 index 000000000..3dd09dae7 --- /dev/null +++ b/packages/graph/list-item/list.ts @@ -0,0 +1,14 @@ +import { addProp } from "@pnp/queryable"; +import { _List } from "../lists/types.js"; +import { ListItems, IListItems } from "./types.js"; + +declare module "../lists/types" { + interface _List { + readonly items: IListItems; + } + interface IList { + readonly items: IListItems; + } +} + +addProp(_List, "items", ListItems); diff --git a/packages/graph/list-item/types.ts b/packages/graph/list-item/types.ts new file mode 100644 index 000000000..a4c6866f9 --- /dev/null +++ b/packages/graph/list-item/types.ts @@ -0,0 +1,55 @@ +import { ListItem as IListItemEntity, ListItemVersion as IListItemVersion } from "@microsoft/microsoft-graph-types"; +import { _GraphQueryableCollection, graphInvokableFactory, _GraphQueryableInstance, IGraphQueryableCollection, GraphQueryableCollection } from "../graphqueryable.js"; +import { defaultPath, deleteable, IDeleteable, updateable, IUpdateable, getById, IGetById } from "../decorators.js"; +import { graphPost } from "../operations.js"; +import { body } from "@pnp/queryable"; + +/** + * Represents a list item entity + */ +@deleteable() +@updateable() +export class _ListItem extends _GraphQueryableInstance { + /** + * Method for retrieving the versions of a list item. + * @returns IListItemVersion + */ + public get versions(): IGraphQueryableCollection { + return GraphQueryableCollection(this, "versions"); + } +} +export interface IListItem extends _ListItem, IDeleteable, IUpdateable { } +export const ListItem = graphInvokableFactory(_ListItem); + +/** + * Describes a collection of list item objects + * + */ +@defaultPath("items") +@getById(ListItem) +export class _ListItems extends _GraphQueryableCollection{ + /** + * Create a new list item as specified in the request body. + * + * @param listItem a JSON representation of a List object. + */ + public async add(listItem: IListItemEntity): Promise { + const data = await graphPost(this, body(listItem)); + + return { + data, + list: (this).getById(data.id), + }; + } +} + +export interface IListItems extends _ListItems, IGetById { } +export const ListItems = graphInvokableFactory(_ListItems); + +/** + * IListAddResult + */ +export interface IListItemAddResult { + list: IListItem; + data: IListItemEntity; +} diff --git a/packages/graph/lists/drive.ts b/packages/graph/lists/drive.ts index 4ee478c90..76277fdbb 100644 --- a/packages/graph/lists/drive.ts +++ b/packages/graph/lists/drive.ts @@ -1,7 +1,7 @@ -import { _Drive } from "../onedrive/types.js"; +import { _Drive } from "../drive/types.js"; import { List, IList } from "./types.js"; -declare module "../onedrive/types" { +declare module "../drive/types" { interface _Drive { getList: () => Promise; } diff --git a/packages/graph/lists/types.ts b/packages/graph/lists/types.ts index cd7558a2a..1e3ea85a2 100644 --- a/packages/graph/lists/types.ts +++ b/packages/graph/lists/types.ts @@ -5,23 +5,23 @@ import { graphPost } from "../operations.js"; import { body } from "@pnp/queryable"; /** - * Represents a booking service entity + * Represents a list entity */ @deleteable() @updateable() -export class _List extends _GraphQueryableInstance { } +export class _List extends _GraphQueryableInstance {} export interface IList extends _List, IDeleteable, IUpdateable { } export const List = graphInvokableFactory(_List); /** - * Describes a collection of booking service objects + * Describes a collection of list objects * */ -@defaultPath("services") +@defaultPath("lists") @getById(List) export class _Lists extends _GraphQueryableCollection{ /** - * Create a new booking service as specified in the request body. + * Create a new list as specified in the request body. * * @param list a JSON representation of a List object. */ diff --git a/packages/graph/mail/funcs.ts b/packages/graph/mail/funcs.ts new file mode 100644 index 000000000..6bf0906ee --- /dev/null +++ b/packages/graph/mail/funcs.ts @@ -0,0 +1,20 @@ +import { IGraphQueryable, GraphQueryableCollection, IGraphQueryableCollection } from "../graphqueryable.js"; +import { graphPost } from "../operations.js"; +import { body } from "@pnp/queryable"; +import { Message } from "@microsoft/microsoft-graph-types"; + +// export interface IMessage extends Message { +// attachments: +// } +/** + * Get the occurrences, exceptions, and single instances of events in a calendar view defined by a time range, + * from the user's default calendar, or from some other calendar of the user's + * + * @param this IGraphQueryable instance + * @param message - should roughly match Message type in @microsoft/microsoft-graph-types. + * Am not typing the property because attaching a file require the property "@odata.type": "#microsoft.graph.fileAttachment" + * which is not included the typing and therefore will make the function unusable in that scenario. + */ +export function mailSend(this: IGraphQueryable, message: any): Promise { + return graphPost(GraphQueryableCollection(this, "mailSend"), body(message)); +} diff --git a/packages/graph/mail/groups.ts b/packages/graph/mail/groups.ts new file mode 100644 index 000000000..e69de29bb diff --git a/packages/graph/mail/index.ts b/packages/graph/mail/index.ts new file mode 100644 index 000000000..b9f93edaa --- /dev/null +++ b/packages/graph/mail/index.ts @@ -0,0 +1,5 @@ +import "./users.js"; + +// export { + +// } from "./types.js"; diff --git a/packages/graph/mail/types.ts b/packages/graph/mail/types.ts new file mode 100644 index 000000000..e69de29bb diff --git a/packages/graph/mail/users.ts b/packages/graph/mail/users.ts new file mode 100644 index 000000000..f8bc4cb35 --- /dev/null +++ b/packages/graph/mail/users.ts @@ -0,0 +1,20 @@ +// import { addProp } from "@pnp/queryable"; +import { _User } from "../users/types.js"; +// import { Calendar, ICalendar, IEvents, Events, Calendars, ICalendars } from "./types.js"; +import { mailSend } from "./funcs.js"; +// import { IGraphQueryableCollection } from "../graphqueryable.js"; + +declare module "../users/types" { + interface _User { + mailSend(message: any): void; + } + interface IUser { + mailSend(message: any): void; + } +} + +// addProp(_User, "calendar", Calendar); +// addProp(_User, "calendars", Calendars); +// addProp(_User, "events", Events); + +_User.prototype.mailSend = mailSend; diff --git a/packages/graph/presets/all.ts b/packages/graph/presets/all.ts index 4c37b799f..a53002f4a 100644 --- a/packages/graph/presets/all.ts +++ b/packages/graph/presets/all.ts @@ -9,7 +9,7 @@ import "../insights/index.js"; import "../invitations/index.js"; import "../members/index.js"; import "../messages/index.js"; -import "../onedrive/index.js"; +import "../drive/index.js"; import "../onenote/index.js"; import "../photos/index.js"; import "../planner/index.js"; @@ -30,7 +30,7 @@ export * from "../insights/index.js"; export * from "../invitations/index.js"; export * from "../members/index.js"; export * from "../messages/index.js"; -export * from "../onedrive/index.js"; +export * from "../drive/index.js"; export * from "../onenote/index.js"; export * from "../photos/index.js"; export * from "../planner/index.js"; diff --git a/packages/graph/shares/types.ts b/packages/graph/shares/types.ts index ee8c7fa27..aed1aa7ba 100644 --- a/packages/graph/shares/types.ts +++ b/packages/graph/shares/types.ts @@ -1,7 +1,7 @@ import { defaultPath } from "../decorators.js"; import { graphInvokableFactory, _GraphQueryableCollection, _GraphQueryableInstance } from "../graphqueryable.js"; import { SharedDriveItem as ISharedDriveItem } from "@microsoft/microsoft-graph-types"; -import { DriveItem, IDriveItem } from "../onedrive/types.js"; +import { DriveItem, IDriveItem } from "../drive/types.js"; /** * Shares diff --git a/test/graph/analytics.ts b/test/graph/analytics.ts new file mode 100644 index 000000000..b8d8de710 --- /dev/null +++ b/test/graph/analytics.ts @@ -0,0 +1,137 @@ +import { expect } from "chai"; +import "@pnp/graph/users"; +import "@pnp/graph/drive"; +import "@pnp/graph/sites"; +import "@pnp/graph/lists"; +import "@pnp/graph/list-item"; +import "@pnp/graph/analytics"; +import { List } from "@microsoft/microsoft-graph-types"; +import { getRandomString, stringIsNullOrEmpty } from "@pnp/core"; +import { IAnalyticsOptions } from "@pnp/graph/analytics"; +import getTestingGraphSPSite from "./utilities/getTestingGraphSPSite.js"; + +describe.only("Analytics", function () { + let testUserName = ""; + let site = null; + let driveId = null; + let listResultId = null; + let listItemId = null; + + const fileOptions = { + content: "This is some test content", + filePathName: "pnpTest.txt", + contentType: "text/plain;charset=utf-8", + }; + const sampleList: List = { + displayName: "PnPGraphTestListItemAnalytics", + list: { "template": "genericList" }, + }; + + // Ensure we have the data to test against + before(async function () { + + if (!this.pnp.settings.enableWebTests || stringIsNullOrEmpty(this.pnp.settings.testUser)) { + this.skip(); + } + + // Create a sample list + try { + site = await getTestingGraphSPSite(this); + const listResult = await site.lists.add(sampleList); + listResultId = listResult.data.id; + const listItemProps: any = { + fields: { + title: "Test Item", + }, + }; + const listItem = await site.lists.getById(listResultId).items.add(listItemProps); + listItemId = listItem.data.id; + } catch (err) { + console.log("Could not create a sample list and item."); + } + // Get a sample user + try { + testUserName = this.pnp.settings.testUser.substring(this.pnp.settings.testUser.lastIndexOf("|") + 1); + const drives = await this.pnp.graph.users.getById(testUserName).drives(); + if (drives.length > 0) { + driveId = drives[0].id; + } + } catch (err) { + console.log("Could not retrieve user's drives"); + } + }); + + it("Get Drive Item Analytics - Last Seven Days", async function () { + if (stringIsNullOrEmpty(driveId)) { + this.skip(); + } + const testFileName = `TestFile_${getRandomString(4)}.txt`; + const fo = JSON.parse(JSON.stringify(fileOptions)); + fo.filePathName = testFileName; + const children = await this.pnp.graph.users.getById(testUserName).drives.getById(driveId).root.upload(fo); + const analytics = await this.pnp.graph.users.getById(testUserName).drives.getById(driveId).getItemById(children.data.id).analytics(); + return expect(analytics).to.haveOwnProperty("@odata.context").eq("https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.itemActivityStat"); + }); + + it("Get List Item Analytics - Last Seven Days", async function () { + if (stringIsNullOrEmpty(listItemId)) { + this.skip(); + } + const analytics = await site.lists.getById(listResultId).items.getById(listItemId).analytics(); + return expect(analytics).to.haveOwnProperty("@odata.context").eq("https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.itemActivityStat"); + }); + + it("Get Site Analytics - Last Seven Days", async function () { + if (stringIsNullOrEmpty(driveId)) { + this.skip(); + } + const site = this.pnp.graph.sites.getById(this.pnp.settings.graph.id); + const analytics = await site.analytics(); + return expect(analytics).to.haveOwnProperty("@odata.context").eq("https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.itemActivityStat"); + }); + + it("Get Drive Item Analytics - All Time", async function () { + if (stringIsNullOrEmpty(driveId)) { + this.skip(); + } + const testFileName = `TestFile_${getRandomString(4)}.txt`; + const fo = JSON.parse(JSON.stringify(fileOptions)); + fo.filePathName = testFileName; + const children = await this.pnp.graph.users.getById(testUserName).drives.getById(driveId).root.upload(fo); + const options: IAnalyticsOptions = { timeRange: "allTime" }; + const analytics = await this.pnp.graph.users.getById(testUserName).drives.getById(driveId).getItemById(children.data.id).analytics(options); + return expect(analytics).to.haveOwnProperty("@odata.context").eq("https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.itemActivityStat"); + }); + + it("Get List Item Analytics - All Time", async function () { + if (stringIsNullOrEmpty(listItemId)) { + this.skip(); + } + const options: IAnalyticsOptions = { timeRange: "allTime" }; + const analytics = await site.lists.getById(listResultId).items.getById(listItemId).analytics(options); + return expect(analytics).to.haveOwnProperty("@odata.context").eq("https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.itemActivityStat"); + }); + + it("Get Site Analytics - All Time", async function () { + if (stringIsNullOrEmpty(driveId)) { + this.skip(); + } + const site = this.pnp.graph.sites.getById(this.pnp.settings.graph.id); + const options: IAnalyticsOptions = { timeRange: "allTime" }; + const analytics = await site.analytics(options); + return expect(analytics).to.haveOwnProperty("@odata.context").eq("https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.itemActivityStat"); + }); + + // Remove the test contact we created + after(async function () { + + if (!stringIsNullOrEmpty(listResultId)) { + try { + await site.lists.getById(listResultId).delete(); + } catch (err) { + console.error(`Cannot clean up test contact: ${listResultId}`); + } + } + return; + }); +}); diff --git a/test/graph/onedrive.ts b/test/graph/drive.ts similarity index 94% rename from test/graph/onedrive.ts rename to test/graph/drive.ts index 54952b47c..300835d93 100644 --- a/test/graph/onedrive.ts +++ b/test/graph/drive.ts @@ -3,14 +3,14 @@ import * as path from "path"; import * as fs from "fs"; import findupSync from "findup-sync"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; import { getRandomString, stringIsNullOrEmpty } from "@pnp/core"; -import { IAnalyticsOptions, IItemOptions } from "@pnp/graph/onedrive/types"; +import { IItemOptions } from "@pnp/graph/drive/types"; // give ourselves a single reference to the projectRoot const projectRoot = path.resolve(path.dirname(findupSync("package.json"))); -describe("OneDrive", function () { +describe("Drive", function () { let testUserName = ""; let driveId = null; const fileOptions = { @@ -350,16 +350,4 @@ describe("OneDrive", function () { } return expect(previewDriveItem).to.haveOwnProperty("getUrl"); }); - - it("Get Drive Item Analytics - Last Seven Days", async function () { - if (stringIsNullOrEmpty(driveId)) { - this.skip(); - } - const testFileName = `TestFile_${getRandomString(4)}.txt`; - const fo = JSON.parse(JSON.stringify(fileOptions)); - fo.filePathName = testFileName; - const children = await this.pnp.graph.users.getById(testUserName).drives.getById(driveId).root.upload(fo); - const analytics = await this.pnp.graph.users.getById(testUserName).drives.getById(driveId).getItemById(children.data.id).analytics()(); - return expect(analytics).to.haveOwnProperty("@odata.context"); - }); }); diff --git a/test/graph/lists.ts b/test/graph/lists.ts index dec278374..7bd2a6700 100644 --- a/test/graph/lists.ts +++ b/test/graph/lists.ts @@ -6,7 +6,7 @@ import { ISite } from "@pnp/graph/sites"; import { getRandomString } from "@pnp/core"; import getTestingGraphSPSite from "./utilities/getTestingGraphSPSite.js"; -describe("Lists", function () { +describe.only("Lists", function () { let site: ISite; const sampleList: List = { displayName: "PnPGraphTestList", diff --git a/test/graph/querable.ts b/test/graph/querable.ts index 012d2e8b1..faeefbbe5 100644 --- a/test/graph/querable.ts +++ b/test/graph/querable.ts @@ -1,7 +1,7 @@ import { expect } from "chai"; import "@pnp/graph/sites/group"; import "@pnp/graph/users"; -import "@pnp/graph/onedrive"; +import "@pnp/graph/drive"; import { Drive, Group } from "@microsoft/microsoft-graph-types"; import { hOP, stringIsNullOrEmpty } from "@pnp/core"; import getValidUser from "./utilities/getValidUser.js"; From 75d6fbd2eaea6c969902ebf1a75ff522e1efec6f Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 28 Aug 2023 13:44:20 +0000 Subject: [PATCH 26/33] Merge conflict fix --- CHANGELOG.md | 35 +++++ debug/launch/graph.ts | 22 +-- docs/graph/{drive.md => files.md} | 96 ++++++++----- docs/graph/onedrive.md | 0 docs/graph/operations.md | 22 +++ docs/graph/permissions.md | 79 +++++++++++ docs/graph/shares.md | 2 +- docs/graph/sites.md | 136 +++++++++++++++++- docs/graph/users.md | 2 +- mkdocs.yml | 6 +- package.json | 2 +- packages/graph/attachments/types.ts | 7 +- packages/graph/batching.ts | 3 +- packages/graph/behaviors/paged.ts | 55 +------- packages/graph/behaviors/spfx.ts | 17 +++ packages/graph/bookings/funcs.ts | 6 +- packages/graph/bookings/types.ts | 31 ++--- packages/graph/calendars/funcs.ts | 14 +- packages/graph/calendars/types.ts | 11 +- packages/graph/calendars/users.ts | 6 +- packages/graph/cloud-communications/types.ts | 7 +- packages/graph/columns/addColumns.ts | 4 +- packages/graph/columns/content-types.ts | 2 +- packages/graph/columns/types.ts | 6 +- packages/graph/contacts/types.ts | 11 +- packages/graph/content-types/lists.ts | 5 +- packages/graph/content-types/sites.ts | 5 +- packages/graph/content-types/types.ts | 7 +- packages/graph/conversations/types.ts | 21 +-- packages/graph/decorators.ts | 3 +- packages/graph/directory-objects/types.ts | 7 +- packages/graph/{drive => files}/funcs.ts | 6 +- packages/graph/{drive => files}/groups.ts | 0 packages/graph/{drive => files}/index.ts | 2 + packages/graph/{drive => files}/sites.ts | 0 packages/graph/{drive => files}/types.ts | 74 ++++++---- packages/graph/{drive => files}/users.ts | 2 +- packages/graph/graphqueryable.ts | 85 +++++++++--- packages/graph/groups/types.ts | 3 +- packages/graph/index.ts | 12 +- packages/graph/insights/types.ts | 20 +-- packages/graph/invitations/types.ts | 5 +- packages/graph/lists/drive.ts | 4 +- packages/graph/lists/types.ts | 7 +- packages/graph/members/types.ts | 7 +- packages/graph/messages/types.ts | 12 +- packages/graph/messages/users.ts | 2 +- packages/graph/onenote/types.ts | 24 ++-- packages/graph/operations.ts | 22 --- packages/graph/operations/index.ts | 7 + packages/graph/operations/list.ts | 14 ++ packages/graph/operations/site.ts | 14 ++ packages/graph/operations/types.ts | 11 ++ packages/graph/outlook/types.ts | 8 +- packages/graph/permissions/index.ts | 8 ++ packages/graph/permissions/site.ts | 14 ++ packages/graph/permissions/types.ts | 28 ++++ packages/graph/photos/types.ts | 5 +- packages/graph/planner/types.ts | 21 ++- packages/graph/presets/all.ts | 6 +- packages/graph/search/types.ts | 5 +- packages/graph/shares/types.ts | 8 +- packages/graph/sites/index.ts | 1 + packages/graph/sites/types.ts | 61 +++++++- packages/graph/sites/user.ts | 14 ++ packages/graph/subscriptions/types.ts | 7 +- packages/graph/teams/index.ts | 2 +- packages/graph/teams/types.ts | 25 ++-- packages/sp/appcatalog/types.ts | 2 +- packages/sp/attachments/types.ts | 2 +- packages/sp/batching.ts | 3 +- packages/sp/behaviors/request-digest.ts | 3 +- packages/sp/behaviors/spfx.ts | 17 +++ packages/sp/clientside-pages/types.ts | 3 +- packages/sp/clientside-pages/web.ts | 3 +- packages/sp/column-defaults/list.ts | 2 +- packages/sp/comments/clientside-page.ts | 3 +- packages/sp/comments/item.ts | 3 +- packages/sp/comments/types.ts | 3 +- packages/sp/content-types/types.ts | 3 +- packages/sp/context-info/index.ts | 3 +- packages/sp/favorites/types.ts | 3 +- packages/sp/features/types.ts | 2 +- packages/sp/fields/types.ts | 3 +- packages/sp/files/types.ts | 3 +- packages/sp/folders/types.ts | 3 +- packages/sp/groupsitemanager/types.ts | 3 +- packages/sp/hubsites/site.ts | 2 +- packages/sp/hubsites/web.ts | 2 +- packages/sp/index.ts | 2 - packages/sp/items/get-all.ts | 52 ------- packages/sp/items/index.ts | 1 - packages/sp/items/types.ts | 96 +++++++------ packages/sp/lists/types.ts | 3 +- packages/sp/navigation/types.ts | 3 +- packages/sp/operations.ts | 33 ----- packages/sp/profiles/types.ts | 2 +- packages/sp/recycle-bin/types.ts | 2 +- packages/sp/regional-settings/funcs.ts | 3 +- packages/sp/regional-settings/types.ts | 2 +- packages/sp/related-items/types.ts | 3 +- packages/sp/search/query.ts | 3 +- packages/sp/security/funcs.ts | 3 +- packages/sp/security/types.ts | 3 +- packages/sp/sharing/funcs.ts | 3 +- packages/sp/sharing/web.ts | 2 +- packages/sp/site-designs/types.ts | 4 +- packages/sp/site-groups/types.ts | 3 +- packages/sp/site-groups/web.ts | 2 +- packages/sp/site-scripts/types.ts | 3 +- packages/sp/site-users/types.ts | 3 +- packages/sp/site-users/web.ts | 2 +- packages/sp/sites/types.ts | 3 +- packages/sp/social/types.ts | 2 +- packages/sp/spqueryable.ts | 34 ++++- packages/sp/sputilities/types.ts | 3 +- packages/sp/subscriptions/types.ts | 4 +- packages/sp/taxonomy/types.ts | 3 +- packages/sp/user-custom-actions/types.ts | 3 +- packages/sp/views/types.ts | 3 +- packages/sp/webparts/types.ts | 2 +- packages/sp/webs/types.ts | 3 +- test/core/assumptions.ts | 9 +- test/core/storage.ts | 29 ++-- test/core/timeline.ts | 25 ++-- test/core/util.ts | 138 +++++++++++-------- test/graph/batch.ts | 26 ++-- test/graph/calendars.ts | 2 + test/graph/columns.ts | 138 ++++++++++++------- test/graph/contacts.ts | 2 + test/graph/content-types.ts | 135 ++++++++++++------ test/graph/directoryobjects.ts | 87 +++++++----- test/graph/{drive.ts => files.ts} | 4 +- test/graph/groups.ts | 84 +++++------ test/graph/lists.ts | 42 ++++-- test/graph/paging.ts | 12 +- test/graph/querable.ts | 2 +- test/graph/sites.ts | 5 +- test/pnp-test.ts | 10 ++ test/sp/batch.ts | 2 +- test/sp/items.ts | 27 +--- test/test-recording.ts | 3 + 142 files changed, 1436 insertions(+), 886 deletions(-) rename docs/graph/{drive.md => files.md} (89%) create mode 100644 docs/graph/onedrive.md create mode 100644 docs/graph/operations.md create mode 100644 docs/graph/permissions.md rename packages/graph/{drive => files}/funcs.ts (84%) rename packages/graph/{drive => files}/groups.ts (100%) rename packages/graph/{drive => files}/index.ts (95%) rename packages/graph/{drive => files}/sites.ts (100%) rename packages/graph/{drive => files}/types.ts (86%) rename packages/graph/{drive => files}/users.ts (97%) delete mode 100644 packages/graph/operations.ts create mode 100644 packages/graph/operations/index.ts create mode 100644 packages/graph/operations/list.ts create mode 100644 packages/graph/operations/site.ts create mode 100644 packages/graph/operations/types.ts create mode 100644 packages/graph/permissions/index.ts create mode 100644 packages/graph/permissions/site.ts create mode 100644 packages/graph/permissions/types.ts create mode 100644 packages/graph/sites/user.ts delete mode 100644 packages/sp/items/get-all.ts delete mode 100644 packages/sp/operations.ts rename test/graph/{drive.ts => files.ts} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc16dabe2..49c69bd16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,43 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +- graph + - limitation on chaining site operations from sites.getByUrl + ### Added +- graph + - explict error thrown if SPFx context is null or undefined when needed + - followed sites support for users + - ISite now supports `async rebase()` to ensure any ISite is represented by the url pattern /sites/{site id} regardless of how it was first loaded + - ISites.getAllSites() + - support for operations for ISite and IList + +- sp + - explict error thrown if SPFx context is null or undefined when needed + ### Removed +- graph + - paged method removed from IGraphQueryableCollection + - ./operations.ts methods moved to ./graphqueryable.ts + +- sp + - getPaged method removed from _Items/IItems + - PagedItemCollection removed from library + - removed /items/get-all import, unneeded, use async iterator patterns + - ./operations.ts methods moved to ./spqueryable.ts + ### Changed + +- graph + - IGraphQueryableCollection now supports async iterator pattern + - IGraphQueryableCollection count method now returns -1 if the collection does not support counting + - All GraphQueryable*, _GraphQueryable*, and IGraphQueryable* have been renamed to remove "Queryable" (ex: GraphQueryableCollection is now GraphCollection) + - @pnp/graph/onedrive renamed to @pnp/graph/files + - ISites.getByUrl is now async + +- sp + - _Items and IItems now supports async iterator pattern + + diff --git a/debug/launch/graph.ts b/debug/launch/graph.ts index f2646a551..9fe04eec9 100644 --- a/debug/launch/graph.ts +++ b/debug/launch/graph.ts @@ -6,15 +6,15 @@ declare var process: { exit(code?: number): void }; export async function Example(settings: any) { - const graph = graphSetup(settings); + const graph = graphSetup(settings); - const users = await graph.users(); - - Logger.log({ - data: users, - level: LogLevel.Info, - message: "List of Users Data", - }); - - process.exit(0); -} \ No newline at end of file + const users = await graph.users(); + + Logger.log({ + data: users, + level: LogLevel.Info, + message: "List of Users Data", + }); + + process.exit(0); +} diff --git a/docs/graph/drive.md b/docs/graph/files.md similarity index 89% rename from docs/graph/drive.md rename to docs/graph/files.md index 612d39ff0..d1e0896a8 100644 --- a/docs/graph/drive.md +++ b/docs/graph/files.md @@ -1,7 +1,7 @@ -# @pnp/graph/drive +# @pnp/graph/files -The ability to manage drives and drive items in OneDrive and SharePoint is a capability introduced in version 1.2.4 of @pnp/graph. Through the methods described -you can manage drives and drive items in OneDrive and SharePoint. +The ability to manage drives and drive items in Onedrive is a capability introduced in version 1.2.4 of @pnp/graph. Through the methods described +you can manage drives and drive items in Onedrive. ## IInvitations @@ -9,14 +9,14 @@ you can manage drives and drive items in OneDrive and SharePoint. ## Get the default drive -Using the drive you can get the users default drive from OneDrive, or the groups or sites default document library. +Using the drive you can get the users default drive from Onedrive, or the groups or sites default document library. ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; import "@pnp/graph/groups"; import "@pnp/graph/sites"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -31,14 +31,14 @@ const siteDrive = await graph.sites.getById("{site identifier}").drive(); ## Get all of the drives -Using the drives() you can get the users available drives from OneDrive +Using the drives() you can get the users available drives from Onedrive ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; import "@pnp/graph/groups"; import "@pnp/graph/sites"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -59,7 +59,7 @@ Using the drives.getById() you can get one of the available drives in Outlook ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -78,7 +78,7 @@ Using the list() you get the associated list information ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -94,7 +94,7 @@ Form more infomration about acting on the IList object see [@pnpjs/graph/lists]( ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; import "@pnp/graph/lists"; const graph = graphfi(...); @@ -113,7 +113,7 @@ Using the recent() you get the recent files ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -130,7 +130,7 @@ Using the sharedWithMe() you get the files shared with the user ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -152,7 +152,7 @@ List the items that have been followed by the signed in user. ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -169,7 +169,7 @@ import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; import "@pnp/graph/sites"; import "@pnp/graph/groups"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -194,7 +194,7 @@ Using the children() you get the children ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -215,7 +215,7 @@ Using the drive.getItemsByPath() you can get the contents of a particular folder ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -231,9 +231,9 @@ Using the add you can add an item, for more options please user the upload metho ```TypeScript import { graphfi } from "@pnp/graph"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; import "@pnp/graph/users"; -import {IDriveItemAddResult} from "@pnp/graph/drive"; +import {IDriveItemAddResult} from "@pnp/graph/files"; const graph = graphfi(...); @@ -247,9 +247,9 @@ Using the .upload method you can add or update the content of an item. ```TypeScript import { graphfi } from "@pnp/graph"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; import "@pnp/graph/users"; -import {IFileOptions, IDriveItemAddResult} from "@pnp/graph/drive"; +import {IFileOptions, IDriveItemAddResult} from "@pnp/graph/files"; const graph = graphfi(...); @@ -282,7 +282,7 @@ Using addFolder you can add a folder ```TypeScript import { graph } from "@pnp/graph"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; import "@pnp/graph/users" import {IDriveItemAddResult} from "@pnp/graph/ondrive"; @@ -300,7 +300,7 @@ Using the search() you can search for items, and optionally select properties ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -320,7 +320,7 @@ Using the items.getById() you can get a specific item from the current drive ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -337,7 +337,7 @@ Using the drive.getItemByPath() you can get a specific item from the current dri ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -354,7 +354,7 @@ Using the item.getContent() you can get the content of a file. ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -385,7 +385,7 @@ Using the item.convertContent() you can get a PDF version of the file. See [offi ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -414,7 +414,7 @@ Using the thumbnails() you get the thumbnails ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -431,7 +431,7 @@ Using the delete() you delete the current item ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -448,7 +448,7 @@ Using the update() you update the current item ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -465,7 +465,7 @@ Using the move() you move the current item, and optionally update it ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -491,7 +491,7 @@ Using the copy() you can copy the current item to a new location, returns the pa ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; const graph = graphfi(...); @@ -517,8 +517,8 @@ Using the users default drive you can get special folders, including: Documents, ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; -import { SpecialFolder, IDriveItem } from "@pnp/graph/drive"; +import "@pnp/graph/files"; +import { SpecialFolder, IDriveItem } from "@pnp/graph/files"; const graph = graphfi(...); @@ -540,8 +540,8 @@ If you want to obtain long-lived embeddable links, use the createLink API instea ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; -import { IPreviewOptions, IDriveItemPreviewInfo } from "@pnp/graph/drive"; +import "@pnp/graph/files"; +import { IPreviewOptions, IDriveItemPreviewInfo } from "@pnp/graph/files"; import { ItemPreviewInfo } from "@microsoft/microsoft-graph-types" const graph = graphfi(...); @@ -566,7 +566,7 @@ Track changes in a driveItem and its children over time. ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; import { IDeltaItems } from "@pnp/graph/ondrive"; const graph = graphfi(...); @@ -588,3 +588,27 @@ for await (const val of delta.next.top(20).paged()) { console.log(JSON.stringify(val, null, 2)); } ``` + +## Get Drive Item Analytics + +Using the analytics() you get the ItemAnalytics for a DriveItem + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/users"; +import "@pnp/graph/files"; +import { IAnalyticsOptions } from "@pnp/graph/files"; + +const graph = graphfi(...); + +// Defaults to lastSevenDays +const analytics = await graph.users.getById("user@tenant.onmicrosoft.com").drives.getById("{drive id}").items.getById("{item id}").analytics()(); + +const analytics = await graph.me.drives.getById("{drive id}").items.getById("{item id}").analytics()(); + +const analyticOptions: IAnalyticsOptions = { + timeRange: "allTime" +}; + +const analyticsAllTime = await graph.me.drives.getById("{drive id}").items.getById("{item id}").analytics(analyticOptions)(); +``` diff --git a/docs/graph/onedrive.md b/docs/graph/onedrive.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/graph/operations.md b/docs/graph/operations.md new file mode 100644 index 000000000..d0d6f0afb --- /dev/null +++ b/docs/graph/operations.md @@ -0,0 +1,22 @@ +# @pnp/graph/operations + +Provides capabilities related to rich long-running operations. + +[![Selective Imports Banner](https://img.shields.io/badge/Selective%20Imports-informational.svg)](../concepts/selective-imports.md) + +## list site operations + +```TypeScript +import "@pnp/graph/sites"; +import "@pnp/graph/operations"; + +const graph = graphfi(...); + +// using getByUrl +const site = await graph.sites.getByUrl("tenant.sharepoint.com", "/sites/dev"); + +const ops = await site.operations(); + +// using site id +const ops2 = await graph.sites.getById("{site id}").operations(); +``` diff --git a/docs/graph/permissions.md b/docs/graph/permissions.md new file mode 100644 index 000000000..ade06dc57 --- /dev/null +++ b/docs/graph/permissions.md @@ -0,0 +1,79 @@ +# @pnp/graph/permissions + +Allows you to manipulate the permissions of various entities. + +[![Selective Imports Banner](https://img.shields.io/badge/Selective%20Imports-informational.svg)](../concepts/selective-imports.md) + +## site permissions + +[![Official Docs](https://img.shields.io/badge/Official_Graph_Docs-social.svg)](https://learn.microsoft.com/en-us/graph/api/resources/permission?view=graph-rest-1.0) + +Allows you to manage application permissions for sites. + +### list site permissions + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; +import "@pnp/graph/permissions"; + +const graph = graphfi(...); + +const permissions = await graph.sites.getById("{site id}").permissions(); +``` + +### get a site permission + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; +import "@pnp/graph/permissions"; + +const graph = graphfi(...); + +const permissions = await graph.sites.getById("{site id}").permissions.getById("{permission id}")(); +``` + +### add a site permission + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; +import "@pnp/graph/permissions"; + +const graph = graphfi(...); + +const permissions = await graph.sites.getById("{site id}").permissions.add({ + roles: ["fullcontrol"], + grantedToIdentities: [{ + id: "89ea5c94-7736-4e25-95ad-3fa95f62b66e", + displayName: "Contoso Time Manager App", + }], +}); +``` + +### update a site permission + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; +import "@pnp/graph/permissions"; + +const graph = graphfi(...); + +const permissions = await graph.sites.getById("{site id}").permissions.getById("{permission id}").update({ + roles: ["read"], +}); +``` + +### delete a site permission + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; +import "@pnp/graph/permissions"; + +const graph = graphfi(...); + +const permissions = await graph.sites.getById("{site id}").permissions.getById("{permission id}").delete(); +``` diff --git a/docs/graph/shares.md b/docs/graph/shares.md index c5fd39684..fd3bc2060 100644 --- a/docs/graph/shares.md +++ b/docs/graph/shares.md @@ -32,7 +32,7 @@ const shareInfo = await graph.shares.getById(shareLink)(); ## Access a Share's driveItem resource -You can also access the full functionality of the driveItem via a share. Find [more details on the capabilities of driveItem here](./drive.md). +You can also access the full functionality of the driveItem via a share. Find [more details on the capabilities of driveItem here](./files.md). ```TS import { graphfi } from "@pnp/graph"; diff --git a/docs/graph/sites.md b/docs/graph/sites.md index 44070b32d..f03603f09 100644 --- a/docs/graph/sites.md +++ b/docs/graph/sites.md @@ -4,7 +4,9 @@ The search module allows you to access the Microsoft Graph Sites API. [![Selective Imports Banner](https://img.shields.io/badge/Selective%20Imports-informational.svg)](../concepts/selective-imports.md) -## Call graph.sites +## sites + +### list ```TypeScript import { graphfi } from "@pnp/graph"; @@ -15,7 +17,7 @@ const graph = graphfi(...); const sitesInfo = await graph.sites(); ``` -## Call graph.sites.getById +### getById ```TypeScript import { graphfi } from "@pnp/graph"; @@ -26,12 +28,10 @@ const graph = graphfi(...); const siteInfo = await graph.sites.getById("{site identifier}")(); ``` -## Call graph.sites.getByUrl +### getByUrl Using the sites.getByUrl() you can get a site using url instead of identifier -![Known Issue Banner](https://img.shields.io/badge/Known%20Issue-important.svg) If you get a site with this method, the graph does not support chaining a request further than .drive. We will review and try and create a work around for this issue. - ```TypeScript import { graphfi } from "@pnp/graph"; import "@pnp/graph/sites"; @@ -42,6 +42,128 @@ const serverRelativeUrl = "/sites/teamsite1"; const siteInfo = await graph.sites.getByUrl(sharepointHostName, serverRelativeUrl)(); ``` -## Make additional calls or recieve items from lists +### getAllSites + +List sites across geographies in an organization. This API can also be used to enumerate all sites in a non-multi-geo tenant. + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; + +const graph = graphfi(...); + +const siteslist = []; + +// use async iterator pattern +for await (const sites of graph.sites.getAllSites()) { + siteslist.push(sites); +} + +// supports query params, here we get the sites in pages of 5 as an example +for await (const sites of graph.sites.getAllSites().top(5)) { + siteslist.push(sites); +} +``` + +## site + +### get + +Access sub-sites of the current site + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; + +const graph = graphfi(...); + +const siteInfo = await graph.sites.getById("{site id}")(); +``` + +### sites + +Access sub-sites of the current site + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; + +const graph = graphfi(...); + +const subsites = await graph.sites.getById("{site id}").sites(); +``` + +### rebase + +Ensures the underlying url used in queries for this site is of the pattern /sites/{site id} regardless of how the ISite instance was addressed. + +>> We internally rebase sites using this method so you probably don't need to call it directly, but it is available in case you do😀 + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; -We don't currently implement all of the available options in graph for sites, rather focusing on the sp library. While we do accept PRs to add functionality, you can [also make calls by path.](./items.md) +const graph = graphfi(...); + +const rebasedSite = await Site([graph.sites, "/sites/tenant.sharepoint.com:/sites/dev:"]).rebase(); + +const items = await rebasedSite.drive.root.children(); +``` + +## followedSites + +Provides access to the sites a user is following. + +### list + +>> At this time you can not list a user's followed sites using app-only permissions + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; +import "@pnp/graph/users"; + +const graph = graphfi(...); + +const followedSites = await graph.me.followedSites(); +``` + +### add + +Adds a followed site to a user's collection + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; +import "@pnp/graph/users"; + +const graph = graphfi(...); + +const followedSites = await graph.me.followedSites.add("{site id}"); + +// supports multiple ids in a single call +const followedSites2 = await graph.me.followedSites.add("{site id}", "{site id2}", "{site id3}", "{site id4}"); + +// callable for any user +const followedSites3 = await graph.users.getById("{user id}").followedSites.add("{site id}", "{site id2}", "{site id3}", "{site id4}"); +``` + +### remove + +Removes a followed site to a user's collection + +```TypeScript +import { graphfi } from "@pnp/graph"; +import "@pnp/graph/sites"; +import "@pnp/graph/users"; + +const graph = graphfi(...); + +await graph.me.followedSites.remove("{site id}"); + +// supports multiple ids in a single call +await graph.me.followedSites.remove("{site id}", "{site id2}", "{site id3}", "{site id4}"); + +// callable for any user +await graph.users.getById("{user id}").followedSites.remove("{site id}", "{site id2}", "{site id3}", "{site id4}"); +``` diff --git a/docs/graph/users.md b/docs/graph/users.md index fff64cc35..f863a0c90 100644 --- a/docs/graph/users.md +++ b/docs/graph/users.md @@ -131,4 +131,4 @@ See [Messages](./messages.md) ## User OneDrive -See [Drive](./drive.md) +See [Files](./files.md) diff --git a/mkdocs.yml b/mkdocs.yml index d1592830d..9b00f5691 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -17,7 +17,7 @@ nav: - 'In NodeJS': 'concepts/auth-nodejs.md' - 'Batching': 'concepts/batching.md' - 'Batching & Caching': 'concepts/batching-caching.md' - - 'Calling Other Endpoints': 'concepts/calling-other-endpoints' + - 'Calling Other Endpoints': 'concepts/calling-other-endpoints.md' - 'Custom Bundling': 'concepts/custom-bundle.md' - 'Error-Handling': 'concepts/error-handling.md' - 'Project Config/Services Setup': 'concepts/project-preset.md' @@ -49,12 +49,14 @@ nav: - 'cloud communications': 'graph/cloud-communications.md' - calendars: 'graph/calendars.md' - 'directory objects': 'graph/directoryobjects.md' + - files: 'graph/files.md' - invitations: 'graph/invitations.md' - items: 'graph/items.md' - lists: 'graph/lists.md' - messages: 'graph/messages.md' - - onedrive: 'graph/onedrive.md' - outlook: 'graph/outlook.md' + - operations: 'graph/operations.md' + - permissions: 'graph/permissions.md' - photos: 'graph/photos.md' - planner: 'graph/planner.md' - search: 'graph/search.md' diff --git a/package.json b/package.json index 412dc4ee8..c2ff3b2bc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@pnp/monorepo", "private": true, "type": "module", - "version": "3.17.0", + "version": "4.0.0-alpha0", "description": "A JavaScript library for SharePoint & Graph development.", "devDependencies": { "@azure/identity": "3.2.4", diff --git a/packages/graph/attachments/types.ts b/packages/graph/attachments/types.ts index 57b2d4c4d..2818fd31f 100644 --- a/packages/graph/attachments/types.ts +++ b/packages/graph/attachments/types.ts @@ -1,14 +1,13 @@ import { Attachment as IAttachmentType } from "@microsoft/microsoft-graph-types"; import { body } from "@pnp/queryable"; -import { _GraphQueryableCollection, _GraphQueryableInstance, graphInvokableFactory } from "../graphqueryable.js"; -import { graphPost } from "../operations.js"; +import { _GraphCollection, _GraphInstance, graphInvokableFactory, graphPost } from "../graphqueryable.js"; import { defaultPath, getById, IGetById } from "../decorators.js"; import { type } from "../utils/type.js"; /** * Attachment */ -export class _Attachment extends _GraphQueryableInstance { } +export class _Attachment extends _GraphInstance { } export interface IAttachment extends _Attachment { } export const Attachment = graphInvokableFactory(_Attachment); @@ -17,7 +16,7 @@ export const Attachment = graphInvokableFactory(_Attachment); */ @defaultPath("attachments") @getById(Attachment) -export class _Attachments extends _GraphQueryableCollection { +export class _Attachments extends _GraphCollection { /** * Add attachment to this collection diff --git a/packages/graph/batching.ts b/packages/graph/batching.ts index 5e306a203..dcfa6fb7a 100644 --- a/packages/graph/batching.ts +++ b/packages/graph/batching.ts @@ -1,7 +1,6 @@ import { isUrlAbsolute, hOP, TimelinePipe, getGUID, CopyFrom, objectDefinedNotNull, isFunc, combine } from "@pnp/core"; import { parseBinderWithErrorCheck, Queryable, body, InjectHeaders } from "@pnp/queryable"; -import { IGraphQueryable, _GraphQueryable } from "./graphqueryable.js"; -import { graphPost } from "./operations.js"; +import { IGraphQueryable, _GraphQueryable, graphPost } from "./graphqueryable.js"; import { GraphFI } from "./fi.js"; declare module "./fi" { diff --git a/packages/graph/behaviors/paged.ts b/packages/graph/behaviors/paged.ts index 94f6a259b..b469a068a 100644 --- a/packages/graph/behaviors/paged.ts +++ b/packages/graph/behaviors/paged.ts @@ -1,6 +1,6 @@ -import { hOP, objectDefinedNotNull, stringIsNullOrEmpty, TimelinePipe } from "@pnp/core"; +import { hOP, stringIsNullOrEmpty, TimelinePipe } from "@pnp/core"; import { errorCheck, parseODataJSON } from "@pnp/queryable"; -import { GraphQueryableCollection, IGraphQueryable, IGraphQueryableCollection } from "../graphqueryable.js"; +import { GraphCollection, IGraphQueryable, IGraphCollection } from "../graphqueryable.js"; import { ConsistencyLevel } from "./consistency-level.js"; export interface IPagedResult { @@ -17,9 +17,9 @@ export interface IPagedResult { * @param col The collection to count * @returns number representing the count */ -export async function Count(col: IGraphQueryableCollection): Promise { +export async function Count(col: IGraphCollection): Promise { - const q = GraphQueryableCollection(col).using(Paged(), ConsistencyLevel()); + const q = GraphCollection(col).using(Paged(), ConsistencyLevel()); q.query.set("$count", "true"); q.top(1); @@ -27,53 +27,6 @@ export async function Count(col: IGraphQueryableCollection): Promise(col: IGraphQueryableCollection): AsyncIterable { - - const q = GraphQueryableCollection(col).using(Paged(), ConsistencyLevel()); - - const queryParams = ["$search", "$top", "$select", "$expand", "$filter", "$orderby"]; - - for (let i = 0; i < queryParams.length; i++) { - const param = col.query.get(queryParams[i]); - if (objectDefinedNotNull(param)) { - q.query.set(queryParams[i], param); - } - } - - return { - - [Symbol.asyncIterator]() { - return >{ - - _next: q, - - async next() { - - if (this._next === null) { - return { done: true, value: undefined }; - } - - const result: IPagedResult = await this._next(); - - if (result.hasNext) { - this._next = GraphQueryableCollection([this._next, result.nextLink]); - return { done: false, value: result.value }; - } else { - this._next = null; - return { done: false, value: result.value }; - } - }, - }; - }, - }; -} - /** * Behavior that converts results to pages when used with a collection (exposed through the paged method of GraphCollection) * diff --git a/packages/graph/behaviors/spfx.ts b/packages/graph/behaviors/spfx.ts index caf542dbf..5c96698d7 100644 --- a/packages/graph/behaviors/spfx.ts +++ b/packages/graph/behaviors/spfx.ts @@ -11,8 +11,23 @@ interface ISPFXContext { }; } +class SPFxTokenNullOrUndefinedError extends Error { + + constructor(behaviorName: string) { + super(`SPFx Context supplied to ${behaviorName} Behavior is null or undefined.`); + } + + public static check(behaviorName: string, context?: ISPFXContext): void { + if (typeof context === "undefined" || context === null) { + throw new SPFxTokenNullOrUndefinedError(behaviorName); + } + } +} + export function SPFxToken(context: ISPFXContext): TimelinePipe { + SPFxTokenNullOrUndefinedError.check("SPFxToken"); + return (instance: Queryable) => { instance.on.auth.replace(async function (url: URL, init: RequestInit) { @@ -32,6 +47,8 @@ export function SPFxToken(context: ISPFXContext): TimelinePipe { export function SPFx(context: ISPFXContext): TimelinePipe { + SPFxTokenNullOrUndefinedError.check("SPFx"); + return (instance: Queryable) => { instance.using( diff --git a/packages/graph/bookings/funcs.ts b/packages/graph/bookings/funcs.ts index b45da518b..2f51e054f 100644 --- a/packages/graph/bookings/funcs.ts +++ b/packages/graph/bookings/funcs.ts @@ -1,5 +1,5 @@ -import { IGraphQueryable, GraphQueryableCollection, IGraphQueryableCollection } from "../graphqueryable.js"; +import { IGraphQueryable, GraphCollection, IGraphCollection } from "../graphqueryable.js"; import { BookingAppointment as IBookingAppointmentEntity } from "@microsoft/microsoft-graph-types"; /** @@ -9,9 +9,9 @@ import { BookingAppointment as IBookingAppointmentEntity } from "@microsoft/micr * @param start start time * @param end end time */ -export function calendarView(this: IGraphQueryable, start: string, end: string): IGraphQueryableCollection { +export function calendarView(this: IGraphQueryable, start: string, end: string): IGraphCollection { - const query = GraphQueryableCollection(this, "calendarView"); + const query = GraphCollection(this, "calendarView"); query.query.set("startDateTime", start); query.query.set("endDateTime", end); return query; diff --git a/packages/graph/bookings/types.ts b/packages/graph/bookings/types.ts index e8d167a6c..bcb323e94 100644 --- a/packages/graph/bookings/types.ts +++ b/packages/graph/bookings/types.ts @@ -7,9 +7,8 @@ import { BookingCurrency as IBookingCurrencyEntity, BookingCustomQuestion as IBookingCustomQuestionEntity, } from "@microsoft/microsoft-graph-types"; -import { _GraphQueryableCollection, graphInvokableFactory, _GraphQueryableInstance } from "../graphqueryable.js"; +import { _GraphCollection, graphInvokableFactory, _GraphInstance, graphPost } from "../graphqueryable.js"; import { defaultPath, deleteable, IDeleteable, updateable, IUpdateable, getById, IGetById } from "../decorators.js"; -import { graphPost } from "../operations.js"; import { body } from "@pnp/queryable"; import { calendarView } from "./funcs.js"; @@ -17,7 +16,7 @@ import { calendarView } from "./funcs.js"; * Describes a Booking Currency entity * */ -export class _BookingCurrency extends _GraphQueryableInstance { } +export class _BookingCurrency extends _GraphInstance { } export interface IBookingCurrency extends _BookingCurrency { } export const BookingCurrency = graphInvokableFactory(_BookingCurrency); @@ -27,7 +26,7 @@ export const BookingCurrency = graphInvokableFactory(_BookingC */ @defaultPath("solutions/bookingCurrencies") @getById(BookingCurrency) -export class _BookingCurrencies extends _GraphQueryableCollection{ } +export class _BookingCurrencies extends _GraphCollection{ } export interface IBookingCurrencies extends _BookingCurrencies, IGetById { } export const BookingCurrencies = graphInvokableFactory(_BookingCurrencies); @@ -36,7 +35,7 @@ export const BookingCurrencies = graphInvokableFactory(_Book */ @deleteable() @updateable() -export class _BookingBusiness extends _GraphQueryableInstance { +export class _BookingBusiness extends _GraphInstance { /** * Get the calendar view for the booking business. */ @@ -99,7 +98,7 @@ export const BookingBusiness = graphInvokableFactory(_BookingB */ @defaultPath("solutions/bookingBusinesses") @getById(BookingBusiness) -export class _BookingBusinesses extends _GraphQueryableCollection{ +export class _BookingBusinesses extends _GraphCollection{ /** * Create a new booking business as specified in the request body. * @@ -130,7 +129,7 @@ export const BookingBusinesses = graphInvokableFactory(_Book */ @deleteable() @updateable() -export class _BookingApointment extends _GraphQueryableInstance { +export class _BookingApointment extends _GraphInstance { /** * Cancel the specified bookingAppointment in the specified bookingBusiness and send a message to the involved customer and staff members. */ @@ -148,7 +147,7 @@ export const BookingAppointment = graphInvokableFactory(_Bo */ @defaultPath("appointments") @getById(BookingAppointment) -export class _BookingAppointments extends _GraphQueryableCollection{ +export class _BookingAppointments extends _GraphCollection{ /** * Create a new booking appointment as specified in the request body. * @@ -172,7 +171,7 @@ export const BookingAppointments = graphInvokableFactory(_ */ @deleteable() @updateable() -export class _BookingCustomer extends _GraphQueryableInstance { } +export class _BookingCustomer extends _GraphInstance { } export interface IBookingCustomer extends _BookingCustomer, IDeleteable, IUpdateable { } export const BookingCustomer = graphInvokableFactory(_BookingCustomer); @@ -182,7 +181,7 @@ export const BookingCustomer = graphInvokableFactory(_BookingC */ @defaultPath("customers") @getById(BookingCustomer) -export class _BookingCustomers extends _GraphQueryableCollection{ +export class _BookingCustomers extends _GraphCollection{ /** * Create a new booking customer as specified in the request body. * @@ -206,7 +205,7 @@ export const BookingCustomers = graphInvokableFactory(_Bookin */ @deleteable() @updateable() -export class _BookingService extends _GraphQueryableInstance { } +export class _BookingService extends _GraphInstance { } export interface IBookingService extends _BookingService, IDeleteable, IUpdateable { } export const BookingService = graphInvokableFactory(_BookingService); @@ -216,7 +215,7 @@ export const BookingService = graphInvokableFactory(_BookingSer */ @defaultPath("services") @getById(BookingService) -export class _BookingServices extends _GraphQueryableCollection{ +export class _BookingServices extends _GraphCollection{ /** * Create a new booking service as specified in the request body. * @@ -240,7 +239,7 @@ export const BookingServices = graphInvokableFactory(_BookingS */ @deleteable() @updateable() -export class _BookingStaffMember extends _GraphQueryableInstance { } +export class _BookingStaffMember extends _GraphInstance { } export interface IBookingStaffMember extends _BookingStaffMember, IDeleteable, IUpdateable { } export const BookingStaffMember = graphInvokableFactory(_BookingStaffMember); @@ -250,7 +249,7 @@ export const BookingStaffMember = graphInvokableFactory(_Bo */ @defaultPath("staffMembers") @getById(BookingStaffMember) -export class _BookingStaffMembers extends _GraphQueryableCollection{ +export class _BookingStaffMembers extends _GraphCollection{ /** * Create a new booking staffmember as specified in the request body. * @@ -274,7 +273,7 @@ export const BookingStaffMembers = graphInvokableFactory(_ */ @deleteable() @updateable() -export class _BookingCustomQuestion extends _GraphQueryableInstance { } +export class _BookingCustomQuestion extends _GraphInstance { } export interface IBookingCustomQuestion extends _BookingCustomQuestion, IDeleteable, IUpdateable { } export const BookingCustomQuestion = graphInvokableFactory(_BookingCustomQuestion); @@ -284,7 +283,7 @@ export const BookingCustomQuestion = graphInvokableFactory{ +export class _BookingCustomQuestions extends _GraphCollection{ /** * Create a new booking customquestions as specified in the request body. * diff --git a/packages/graph/calendars/funcs.ts b/packages/graph/calendars/funcs.ts index 20d78a2e1..9e5480042 100644 --- a/packages/graph/calendars/funcs.ts +++ b/packages/graph/calendars/funcs.ts @@ -1,4 +1,4 @@ -import { IGraphQueryable, GraphQueryableCollection, IGraphQueryableCollection } from "../graphqueryable.js"; +import { IGraphQueryable, GraphCollection, IGraphCollection } from "../graphqueryable.js"; import { EmailAddress, Event as IEvent } from "@microsoft/microsoft-graph-types"; import { Endpoint } from "../behaviors/endpoint.js"; @@ -14,9 +14,9 @@ interface IEventWithTag extends IEvent { * @param start start time * @param end end time */ -export function calendarView(this: IGraphQueryable, start: string, end: string): IGraphQueryableCollection { +export function calendarView(this: IGraphQueryable, start: string, end: string): IGraphCollection { - const query = GraphQueryableCollection(this, "calendarView"); + const query = GraphCollection(this, "calendarView"); query.query.set("startDateTime", start); query.query.set("endDateTime", end); return query; @@ -31,8 +31,8 @@ export type ICalendarViewInfo = IEventWithTag; * @param this IGraphQueryable instance * @param roomList The SMTP address associated with the room list. */ -export function findRooms(this: IGraphQueryable, roomList?: string): IGraphQueryableCollection { - const query = GraphQueryableCollection(this, roomList ? "findRooms(RoomList=@roomList)" : "findRooms"); +export function findRooms(this: IGraphQueryable, roomList?: string): IGraphCollection { + const query = GraphCollection(this, roomList ? "findRooms(RoomList=@roomList)" : "findRooms"); query.using(Endpoint("beta")); if (roomList) { query.query.set("@roomList", `'${roomList}'`); @@ -48,8 +48,8 @@ export function findRooms(this: IGraphQueryable, roomList?: string): IGraphQuery * @param start start time * @param end end time */ -export function instances(this: IGraphQueryable, start: string, end: string): IGraphQueryableCollection { - const query = GraphQueryableCollection(this, "instances"); +export function instances(this: IGraphQueryable, start: string, end: string): IGraphCollection { + const query = GraphCollection(this, "instances"); query.query.set("startDateTime", start); query.query.set("endDateTime", end); return query; diff --git a/packages/graph/calendars/types.ts b/packages/graph/calendars/types.ts index 009a969f9..9dd39a608 100644 --- a/packages/graph/calendars/types.ts +++ b/packages/graph/calendars/types.ts @@ -1,14 +1,13 @@ import { body } from "@pnp/queryable"; import { Event as IEventType, Calendar as ICalendarType } from "@microsoft/microsoft-graph-types"; -import { _GraphQueryableCollection, _GraphQueryableInstance, graphInvokableFactory } from "../graphqueryable.js"; +import { _GraphCollection, _GraphInstance, graphInvokableFactory, graphPost } from "../graphqueryable.js"; import { defaultPath, IDeleteable, deleteable, IUpdateable, updateable, getById, IGetById } from "../decorators.js"; -import { graphPost } from "../operations.js"; import { calendarView, instances } from "./funcs.js"; /** * Calendar */ -export class _Calendar extends _GraphQueryableInstance { +export class _Calendar extends _GraphInstance { public get events(): IEvents { return Events(this); @@ -24,7 +23,7 @@ export const Calendar = graphInvokableFactory(_Calendar); */ @defaultPath("calendars") @getById(Calendar) -export class _Calendars extends _GraphQueryableCollection { } +export class _Calendars extends _GraphCollection { } export interface ICalendars extends _Calendars, IGetById { } export const Calendars = graphInvokableFactory(_Calendars); @@ -33,7 +32,7 @@ export const Calendars = graphInvokableFactory(_Calendars); */ @deleteable() @updateable() -export class _Event extends _GraphQueryableInstance { +export class _Event extends _GraphInstance { public instances = instances; } export interface IEvent extends _Event, IDeleteable, IUpdateable { } @@ -44,7 +43,7 @@ export const Event = graphInvokableFactory(_Event); */ @defaultPath("events") @getById(Event) -export class _Events extends _GraphQueryableCollection { +export class _Events extends _GraphCollection { /** * Adds a new event to the collection diff --git a/packages/graph/calendars/users.ts b/packages/graph/calendars/users.ts index 88d00db0e..7eb87fc4f 100644 --- a/packages/graph/calendars/users.ts +++ b/packages/graph/calendars/users.ts @@ -2,7 +2,7 @@ import { addProp } from "@pnp/queryable"; import { _User } from "../users/types.js"; import { Calendar, ICalendar, IEvents, Events, Calendars, ICalendars } from "./types.js"; import { calendarView, ICalendarViewInfo } from "./funcs.js"; -import { IGraphQueryableCollection } from "../graphqueryable.js"; +import { IGraphCollection } from "../graphqueryable.js"; declare module "../users/types" { interface _User { @@ -10,14 +10,14 @@ declare module "../users/types" { readonly calendars: ICalendars; readonly attachmentFiles: ICalendar; readonly events: IEvents; - calendarView(start: string, end: string): IGraphQueryableCollection; + calendarView(start: string, end: string): IGraphCollection; } interface IUser { readonly calendar: ICalendar; readonly calendars: ICalendars; readonly attachmentFiles: ICalendar; readonly events: IEvents; - calendarView(start: string, end: string): IGraphQueryableCollection; + calendarView(start: string, end: string): IGraphCollection; } } diff --git a/packages/graph/cloud-communications/types.ts b/packages/graph/cloud-communications/types.ts index 59d5a8a23..19684f18a 100644 --- a/packages/graph/cloud-communications/types.ts +++ b/packages/graph/cloud-communications/types.ts @@ -1,8 +1,7 @@ import { Presence as IUserPresence } from "@microsoft/microsoft-graph-types"; -import { _GraphQueryableCollection, graphInvokableFactory, _GraphQueryableInstance } from "../graphqueryable.js"; +import { _GraphCollection, graphInvokableFactory, _GraphInstance, graphPost } from "../graphqueryable.js"; import { defaultPath } from "../decorators.js"; -import { graphPost } from "../operations.js"; import { body } from "@pnp/queryable"; /** @@ -10,12 +9,12 @@ import { body } from "@pnp/queryable"; */ @defaultPath("presence") -export class _Presence extends _GraphQueryableInstance { } +export class _Presence extends _GraphInstance { } export interface IPresence extends _Presence { } export const Presence = graphInvokableFactory(_Presence); @defaultPath("communications") -export class _Communications extends _GraphQueryableCollection { +export class _Communications extends _GraphCollection { /** * Retrieve presence information for a group of users. * diff --git a/packages/graph/columns/addColumns.ts b/packages/graph/columns/addColumns.ts index 76c383e6c..8edb6a224 100644 --- a/packages/graph/columns/addColumns.ts +++ b/packages/graph/columns/addColumns.ts @@ -1,5 +1,5 @@ -import { IColumn } from "./types"; -import { graphPost } from "../operations.js"; +import { IColumn } from "./types.js"; +import { graphPost } from "../graphqueryable.js"; import { body } from "@pnp/queryable"; import { ColumnDefinition as IColumnDefinition, diff --git a/packages/graph/columns/content-types.ts b/packages/graph/columns/content-types.ts index 83f2e8c28..b6d094ed9 100644 --- a/packages/graph/columns/content-types.ts +++ b/packages/graph/columns/content-types.ts @@ -1,5 +1,5 @@ import { addProp, body } from "@pnp/queryable"; -import { graphPost } from "../operations.js"; +import { graphPost } from "../graphqueryable.js"; import { _ContentType } from "../content-types/types.js"; import { Columns, IColumns,IColumn, _Columns } from "./types.js"; import { IColumnAddResult } from "./addColumns.js"; diff --git a/packages/graph/columns/types.ts b/packages/graph/columns/types.ts index 72be18d08..f63a96169 100644 --- a/packages/graph/columns/types.ts +++ b/packages/graph/columns/types.ts @@ -1,7 +1,7 @@ import { ColumnDefinition as IColumnDefinition, } from "@microsoft/microsoft-graph-types"; -import { _GraphQueryableCollection, graphInvokableFactory, _GraphQueryableInstance } from "../graphqueryable.js"; +import { _GraphCollection, graphInvokableFactory, _GraphInstance } from "../graphqueryable.js"; import { defaultPath, deleteable, IDeleteable, getById, IGetById, IUpdateable, updateable } from "../decorators.js"; /** @@ -9,7 +9,7 @@ import { defaultPath, deleteable, IDeleteable, getById, IGetById, IUpdateable, u */ @deleteable() @updateable() -export class _Column extends _GraphQueryableInstance {} +export class _Column extends _GraphInstance {} export interface IColumn extends _Column, IDeleteable, IUpdateable { } export const Column = graphInvokableFactory(_Column); @@ -18,7 +18,7 @@ export const Column = graphInvokableFactory(_Column); */ @defaultPath("columns") @getById(Column) -export class _Columns extends _GraphQueryableCollection{} +export class _Columns extends _GraphCollection{} export interface IColumns extends _Columns, IGetById { } export const Columns = graphInvokableFactory(_Columns); diff --git a/packages/graph/contacts/types.ts b/packages/graph/contacts/types.ts index a0c63f1b0..b8d14e20b 100644 --- a/packages/graph/contacts/types.ts +++ b/packages/graph/contacts/types.ts @@ -1,7 +1,6 @@ -import { _GraphQueryableCollection, _GraphQueryableInstance, graphInvokableFactory } from "../graphqueryable.js"; +import { _GraphCollection, _GraphInstance, graphInvokableFactory, graphPost } from "../graphqueryable.js"; import { Contact as IContactType, ContactFolder as IContactFolderType, EmailAddress as IEmailAddressType } from "@microsoft/microsoft-graph-types"; import { defaultPath, updateable, deleteable, IUpdateable, IDeleteable, getById, IGetById } from "../decorators.js"; -import { graphPost } from "../operations.js"; import { body } from "@pnp/queryable"; /** @@ -9,7 +8,7 @@ import { body } from "@pnp/queryable"; */ @updateable() @deleteable() -export class _Contact extends _GraphQueryableInstance { } +export class _Contact extends _GraphInstance { } export interface IContact extends _Contact, IUpdateable, IDeleteable { } export const Contact = graphInvokableFactory(_Contact); @@ -18,7 +17,7 @@ export const Contact = graphInvokableFactory(_Contact); */ @defaultPath("contacts") @getById(Contact) -export class _Contacts extends _GraphQueryableCollection { +export class _Contacts extends _GraphCollection { /** * Create a new Contact for the user. @@ -60,7 +59,7 @@ export const Contacts = graphInvokableFactory(_Contacts); */ @deleteable() @updateable() -export class _ContactFolder extends _GraphQueryableInstance { +export class _ContactFolder extends _GraphInstance { /** * Gets the contacts in this contact folder */ @@ -83,7 +82,7 @@ export const ContactFolder = graphInvokableFactory(_ContactFolde */ @defaultPath("contactFolders") @getById(ContactFolder) -export class _ContactFolders extends _GraphQueryableCollection { +export class _ContactFolders extends _GraphCollection { /** * Create a new Contact Folder for the user. diff --git a/packages/graph/content-types/lists.ts b/packages/graph/content-types/lists.ts index e1dbb8a3b..ff924d19a 100644 --- a/packages/graph/content-types/lists.ts +++ b/packages/graph/content-types/lists.ts @@ -1,8 +1,7 @@ -import { addProp } from "@pnp/queryable"; -import { graphPost } from "../operations.js"; +import { addProp, body} from "@pnp/queryable"; +import { graphPost } from "../graphqueryable.js"; import { _List } from "../lists/types.js"; import { ContentTypes, IContentType, IContentTypeAddResult, IContentTypes, _ContentTypes } from "./types.js"; -import { body } from "@pnp/queryable"; declare module "../lists/types" { interface _List { diff --git a/packages/graph/content-types/sites.ts b/packages/graph/content-types/sites.ts index 2e6e4aadc..2da9d9378 100644 --- a/packages/graph/content-types/sites.ts +++ b/packages/graph/content-types/sites.ts @@ -1,9 +1,8 @@ -import { addProp } from "@pnp/queryable"; +import { addProp, body } from "@pnp/queryable"; import { ContentType as IContentTypeEntity, } from "@microsoft/microsoft-graph-types"; -import { graphGet, graphPost } from "../operations.js"; -import { body } from "@pnp/queryable"; +import { graphGet, graphPost } from "../graphqueryable.js"; import { Site, _Site } from "../sites/types.js"; import { ContentTypes, IContentType, IContentTypeAddResult, IContentTypes, _ContentTypes } from "./types.js"; diff --git a/packages/graph/content-types/types.ts b/packages/graph/content-types/types.ts index 5dd4cce29..d0e524b37 100644 --- a/packages/graph/content-types/types.ts +++ b/packages/graph/content-types/types.ts @@ -2,9 +2,8 @@ import { ContentType as IContentTypeEntity, ItemReference as IItemReference, } from "@microsoft/microsoft-graph-types"; -import { _GraphQueryableCollection, graphInvokableFactory, _GraphQueryableInstance } from "../graphqueryable.js"; +import { _GraphCollection, graphInvokableFactory, _GraphInstance, graphGet, graphPost } from "../graphqueryable.js"; import { defaultPath, deleteable, IDeleteable, updateable, IUpdateable, getById, IGetById } from "../decorators.js"; -import { graphGet, graphPost } from "../operations.js"; import { body } from "@pnp/queryable"; import { JSONHeaderParse } from "@pnp/queryable"; @@ -13,7 +12,7 @@ import { JSONHeaderParse } from "@pnp/queryable"; */ @deleteable() @updateable() -export class _ContentType extends _GraphQueryableInstance { +export class _ContentType extends _GraphInstance { /** * Check the publishing status of a contentType in a content type hub site. @@ -74,7 +73,7 @@ export const ContentType = graphInvokableFactory(_ContentType); */ @defaultPath("contenttypes") @getById(ContentType) -export class _ContentTypes extends _GraphQueryableCollection{ +export class _ContentTypes extends _GraphCollection{ /** * Add or sync a copy of a published content type from the content type hub to a target site or a list. * diff --git a/packages/graph/conversations/types.ts b/packages/graph/conversations/types.ts index 09138372b..e536fa8b8 100644 --- a/packages/graph/conversations/types.ts +++ b/packages/graph/conversations/types.ts @@ -7,19 +7,20 @@ import { User as IUserType, } from "@microsoft/microsoft-graph-types"; import { - _GraphQueryableCollection, - _GraphQueryableInstance, + _GraphCollection, + _GraphInstance, graphInvokableFactory, + graphPost, + graphDelete, } from "../graphqueryable.js"; import { defaultPath, updateable, IUpdateable, deleteable, IDeleteable, addable, IAddable, getById, IGetById } from "../decorators.js"; -import { graphPost, graphDelete } from "../operations.js"; /** * Conversation */ @updateable() @deleteable() -export class _Conversation extends _GraphQueryableInstance { +export class _Conversation extends _GraphInstance { /** * Get all the threads in a group conversation. @@ -37,7 +38,7 @@ export const Conversation = graphInvokableFactory(_Conversation); @defaultPath("conversations") @addable() @getById(Conversation) -export class _Conversations extends _GraphQueryableCollection { } +export class _Conversations extends _GraphCollection { } export interface IConversations extends _Conversations, IGetById, IAddable { } export const Conversations = graphInvokableFactory(_Conversations); @@ -45,7 +46,7 @@ export const Conversations = graphInvokableFactory(_Conversation * Thread */ @deleteable() -export class _Thread extends _GraphQueryableInstance { +export class _Thread extends _GraphInstance { /** * Get all the threads in a group conversation. @@ -72,7 +73,7 @@ export const Thread = graphInvokableFactory(_Thread); @defaultPath("threads") @addable() @getById(Thread) -export class _Threads extends _GraphQueryableCollection { } +export class _Threads extends _GraphCollection { } export interface IThreads extends _Threads, IGetById, IAddable { } export const Threads = graphInvokableFactory(_Threads); @@ -81,7 +82,7 @@ export const Threads = graphInvokableFactory(_Threads); * Post */ @deleteable() -export class _Post extends _GraphQueryableInstance { +export class _Post extends _GraphInstance { /** * Forward a post to a recipient */ @@ -107,14 +108,14 @@ export const Post = graphInvokableFactory(_Post); @defaultPath("posts") @addable() @getById(Post) -export class _Posts extends _GraphQueryableCollection { } +export class _Posts extends _GraphCollection { } export interface IPosts extends _Posts, IGetById, IAddable { } export const Posts = graphInvokableFactory(_Posts); /** * Senders */ -export class _Senders extends _GraphQueryableCollection { +export class _Senders extends _GraphCollection { /** * Add a new user or group to this senders collection diff --git a/packages/graph/decorators.ts b/packages/graph/decorators.ts index 79a3a59f4..f1b42a861 100644 --- a/packages/graph/decorators.ts +++ b/packages/graph/decorators.ts @@ -1,5 +1,4 @@ -import { IGraphQueryable } from "./graphqueryable.js"; -import { graphDelete, graphPatch, graphPost } from "./operations.js"; +import { IGraphQueryable, graphDelete, graphPatch, graphPost } from "./graphqueryable.js"; import { body, headers } from "@pnp/queryable"; /** diff --git a/packages/graph/directory-objects/types.ts b/packages/graph/directory-objects/types.ts index c1e8b6c13..bd8270102 100644 --- a/packages/graph/directory-objects/types.ts +++ b/packages/graph/directory-objects/types.ts @@ -1,15 +1,14 @@ -import { _GraphQueryableCollection, _GraphQueryableInstance, graphInvokableFactory } from "../graphqueryable.js"; +import { _GraphCollection, _GraphInstance, graphInvokableFactory, graphPost } from "../graphqueryable.js"; import { DirectoryObject as IDirectoryObjectType } from "@microsoft/microsoft-graph-types"; import { defaultPath, getById, IGetById, deleteable, IDeleteable } from "../decorators.js"; import { body } from "@pnp/queryable"; -import { graphPost } from "../operations.js"; import { Count } from "../behaviors/paged.js"; /** * Represents a Directory Object entity */ @deleteable() -export class _DirectoryObject extends _GraphQueryableInstance { +export class _DirectoryObject extends _GraphInstance { /** * Returns all the groups and directory roles that the specified Directory Object is a member of. The check is transitive @@ -48,7 +47,7 @@ export const DirectoryObject = graphInvokableFactory(_Director */ @defaultPath("directoryObjects") @getById(DirectoryObject) -export class _DirectoryObjects extends _GraphQueryableCollection { +export class _DirectoryObjects extends _GraphCollection { /** * Returns the directory objects specified in a list of ids. NOTE: The directory objects returned are the full objects containing all their properties. * The $select query option is not available for this operation. diff --git a/packages/graph/drive/funcs.ts b/packages/graph/files/funcs.ts similarity index 84% rename from packages/graph/drive/funcs.ts rename to packages/graph/files/funcs.ts index a0e20f5c6..34c46f260 100644 --- a/packages/graph/drive/funcs.ts +++ b/packages/graph/files/funcs.ts @@ -1,6 +1,6 @@ import { combine } from "@pnp/core"; import { body, InjectHeaders } from "@pnp/queryable"; -import { graphPost, graphPut } from "../operations.js"; +import { graphPost, graphPut } from "../graphqueryable.js"; import { DriveItem, IDriveItemAddResult, IFileOptions } from "./types.js"; export interface ICheckInOptions { @@ -16,6 +16,10 @@ export function checkOut(): Promise { return graphPost(DriveItem(this, "checkout")); } +export function encodeSharingUrl(url: string): string { + return "u!" + Buffer.from(url, "utf8").toString("base64").replace(/=$/i, "").replace("/", "_").replace("+", "-"); +} + export async function driveItemUpload(fileOptions: IFileOptions): Promise { let path = "/content"; if (fileOptions.filePathName) { diff --git a/packages/graph/drive/groups.ts b/packages/graph/files/groups.ts similarity index 100% rename from packages/graph/drive/groups.ts rename to packages/graph/files/groups.ts diff --git a/packages/graph/drive/index.ts b/packages/graph/files/index.ts similarity index 95% rename from packages/graph/drive/index.ts rename to packages/graph/files/index.ts index 21157d418..8e7bf5ef4 100644 --- a/packages/graph/drive/index.ts +++ b/packages/graph/files/index.ts @@ -10,6 +10,7 @@ export { export { ICheckInOptions, + encodeSharingUrl, } from "./funcs.js"; export { @@ -30,6 +31,7 @@ export { IDeltaItems, IPreviewOptions, IFileOptions, + IAnalyticsOptions, } from "./types.js"; declare module "../fi" { diff --git a/packages/graph/drive/sites.ts b/packages/graph/files/sites.ts similarity index 100% rename from packages/graph/drive/sites.ts rename to packages/graph/files/sites.ts diff --git a/packages/graph/drive/types.ts b/packages/graph/files/types.ts similarity index 86% rename from packages/graph/drive/types.ts rename to packages/graph/files/types.ts index 11abdf1d1..bea36b02f 100644 --- a/packages/graph/drive/types.ts +++ b/packages/graph/files/types.ts @@ -1,18 +1,20 @@ import { - GraphQueryableInstance, - GraphQueryableCollection, - _GraphQueryableInstance, - IGraphQueryableInstance, - IGraphQueryableCollection, - _GraphQueryableCollection, + GraphInstance, + GraphCollection, + _GraphInstance, + IGraphInstance, + IGraphCollection, + _GraphCollection, graphInvokableFactory, GraphQueryable, + graphPatch, + graphPost, + graphPut, } from "../graphqueryable.js"; -import { Drive as IDriveType, DriveItem as IDriveItemType, ItemPreviewInfo as IDriveItemPreviewInfo } from "@microsoft/microsoft-graph-types"; +import { Drive as IDriveType, DriveItem as IDriveItemType, ItemPreviewInfo as IDriveItemPreviewInfo, ItemAnalytics as IItemAnalytics } from "@microsoft/microsoft-graph-types"; import { combine } from "@pnp/core"; import { defaultPath, getById, IGetById, deleteable, IDeleteable, updateable, IUpdateable } from "../decorators.js"; import { body, BlobParse, CacheNever, errorCheck, InjectHeaders } from "@pnp/queryable"; -import { graphPatch, graphPost, graphPut } from "../operations.js"; import { driveItemUpload } from "./funcs.js"; /** @@ -20,7 +22,7 @@ import { driveItemUpload } from "./funcs.js"; * */ @defaultPath("drive") -export class _Drive extends _GraphQueryableInstance { +export class _Drive extends _GraphInstance { /** * Method for retrieving the root folder of a drive. @@ -34,8 +36,8 @@ export class _Drive extends _GraphQueryableInstance { * Method for retrieving the related list resource, for use with SharePoint drives. * @returns IGraphQueryableInstance */ - public get list(): IGraphQueryableInstance { - return GraphQueryableInstance(this, "list"); + public get list(): IGraphInstance { + return GraphInstance(this, "list"); } /** @@ -104,7 +106,7 @@ export const Drive = graphInvokableFactory(_Drive); */ @defaultPath("drives") @getById(Drive) -export class _Drives extends _GraphQueryableCollection { } +export class _Drives extends _GraphCollection { } export interface IDrives extends _Drives, IGetById { } export const Drives = graphInvokableFactory(_Drives); @@ -113,7 +115,7 @@ export const Drives = graphInvokableFactory(_Drives); * */ @defaultPath("root") -export class _Root extends _GraphQueryableInstance { +export class _Root extends _GraphInstance { /** * Method for retrieving children of a folder drive item. @@ -128,16 +130,16 @@ export class _Root extends _GraphQueryableInstance { * @param query string, search parameter * @returns IGraphQueryableCollection */ - public search(query: string): IGraphQueryableCollection { - return GraphQueryableCollection(this, `search(q='${query}')`); + public search(query: string): IGraphCollection { + return GraphCollection(this, `search(q='${query}')`); } /** * Method for retrieving thumbnails of the drive items. * @returns IGraphQueryableCollection */ - public get thumbnails(): IGraphQueryableCollection { - return GraphQueryableCollection(this, "thumbnails"); + public get thumbnails(): IGraphCollection { + return GraphCollection(this, "thumbnails"); } /** @@ -146,10 +148,10 @@ export class _Root extends _GraphQueryableInstance { * change token * @returns IDeltaItems */ - public delta(token?: string): IGraphQueryableCollection { + public delta(token?: string): IGraphCollection { const path = `delta${(token) ? `(token=${token})` : ""}`; - const query: IGraphQueryableCollection = GraphQueryableCollection(this, path); + const query: IGraphCollection = GraphCollection(this, path); query.on.parse.replace(errorCheck); query.on.parse(async (url: URL, response: Response, result: any): Promise<[URL, Response, any]> => { @@ -159,8 +161,8 @@ export class _Root extends _GraphQueryableInstance { result = { // TODO:: update docs to show how to load next with async iterator - next: () => (nextLink ? GraphQueryableCollection([this, nextLink]) : null), - delta: () => (deltaLink ? GraphQueryableCollection([query, deltaLink])() : null), + next: () => (nextLink ? GraphCollection([this, nextLink]) : null), + delta: () => (deltaLink ? GraphCollection([query, deltaLink])() : null), values: json.value, }; @@ -193,7 +195,7 @@ export const Root = graphInvokableFactory(_Root); */ @deleteable() @updateable() -export class _DriveItem extends _GraphQueryableInstance { +export class _DriveItem extends _GraphInstance { /** * Method for retrieving children of a folder drive item. @@ -207,16 +209,16 @@ export class _DriveItem extends _GraphQueryableInstance { * Method for retrieving thumbnails of the drive items. * @returns IGraphQueryableCollection */ - public get thumbnails(): IGraphQueryableCollection { - return GraphQueryableCollection(this, "thumbnails"); + public get thumbnails(): IGraphCollection { + return GraphCollection(this, "thumbnails"); } /** * Method for retrieving the versions of a drive item. * @returns IDriveItemVersionInfo */ - public get versions(): IGraphQueryableCollection { - return GraphQueryableCollection(this, "versions"); + public get versions(): IGraphCollection { + return GraphCollection(this, "versions"); } /** @@ -344,6 +346,16 @@ export class _DriveItem extends _GraphQueryableInstance { public async preview(previewOptions?: IPreviewOptions): Promise { return graphPost(DriveItem(this, "preview"), body(previewOptions)); } + + /** + * Method for getting item analytics. Defaults to lastSevenDays. + * @param analyticsOptions - IAnalyticsOptions (Optional) + * @returns IGraphQueryableCollection + */ + public analytics(analyticsOptions?: IAnalyticsOptions): IGraphCollection { + const query = `analytics/${analyticsOptions ? analyticsOptions.timeRange : "lastSevenDays"}`; + return >GraphCollection(this, query); + } } export interface IDriveItem extends _DriveItem, IDeleteable, IUpdateable { } export const DriveItem = graphInvokableFactory(_DriveItem); @@ -354,7 +366,7 @@ export const DriveItem = graphInvokableFactory(_DriveItem); * */ @getById(DriveItem) -export class _DriveItems extends _GraphQueryableCollection { +export class _DriveItems extends _GraphCollection { /** * Adds a file to this collection of drive items. * For more upload options please see the .upload method on DriveItem and Root. @@ -462,7 +474,11 @@ export interface IPreviewOptions { } export interface IDeltaItems { - next: IGraphQueryableCollection; - delta: IGraphQueryableCollection; + next: IGraphCollection; + delta: IGraphCollection; values: any[]; } + +export interface IAnalyticsOptions { + timeRange: "allTime" | "lastSevenDays"; +} diff --git a/packages/graph/drive/users.ts b/packages/graph/files/users.ts similarity index 97% rename from packages/graph/drive/users.ts rename to packages/graph/files/users.ts index 0fbdebdeb..bbb4fd651 100644 --- a/packages/graph/drive/users.ts +++ b/packages/graph/files/users.ts @@ -1,5 +1,5 @@ import { addProp, body } from "@pnp/queryable"; -import { graphPost } from "../operations.js"; +import { graphPost } from "../graphqueryable.js"; import { _User } from "../users/types.js"; import { IDrive, Drive, IDrives, Drives, _Drive, DriveItem, IDriveItem, _DriveItem, IItemOptions } from "./types.js"; diff --git a/packages/graph/graphqueryable.ts b/packages/graph/graphqueryable.ts index 77d029776..f2e221d42 100644 --- a/packages/graph/graphqueryable.ts +++ b/packages/graph/graphqueryable.ts @@ -1,11 +1,11 @@ -import { isArray } from "@pnp/core"; -import { IInvokable, Queryable, queryableFactory } from "@pnp/queryable"; +import { isArray, objectDefinedNotNull } from "@pnp/core"; +import { IInvokable, Queryable, queryableFactory, op, get, post, patch, del, put } from "@pnp/queryable"; import { ConsistencyLevel } from "./behaviors/consistency-level.js"; -import { AsAsyncIterable } from "./behaviors/paged.js"; +import { IPagedResult, Paged } from "./behaviors/paged.js"; export type GraphInit = string | IGraphQueryable | [IGraphQueryable, string]; -export interface IGraphQueryableConstructor { +export interface IGraphConstructor { new(base: GraphInit, path?: string): T; } @@ -78,7 +78,7 @@ export class _GraphQueryable extends Queryable { * @param factory The contructor for the class to create */ protected getParent( - factory: IGraphQueryableConstructor, + factory: IGraphConstructor, base: GraphInit = this.parentUrl, path?: string): T { @@ -98,7 +98,7 @@ export const GraphQueryable = graphInvokableFactory(_GraphQuery * Represents a REST collection which can be filtered, paged, and selected * */ -export class _GraphQueryableCollection extends _GraphQueryable { +export class _GraphCollection extends _GraphQueryable { /** * @@ -171,23 +171,72 @@ export class _GraphQueryableCollection extends _GraphQueryable< return -1; } - /** - * Allows reading through a collection as pages of information whose size is determined by top or the api method's default - * - * @returns an object containing results, the ability to determine if there are more results, and request the next page of results - */ - public paged(): AsyncIterable { - return AsAsyncIterable(this); + public [Symbol.asyncIterator]() { + + const q = GraphCollection(this).using(Paged(), ConsistencyLevel()); + + const queryParams = ["$search", "$top", "$select", "$expand", "$filter", "$orderby"]; + + for (let i = 0; i < queryParams.length; i++) { + const param = this.query.get(queryParams[i]); + if (objectDefinedNotNull(param)) { + q.query.set(queryParams[i], param); + } + } + + return >{ + + _next: q, + + async next() { + + if (this._next === null) { + return { done: true, value: undefined }; + } + + const result: IPagedResult = await this._next(); + + if (result.hasNext) { + this._next = GraphCollection([this._next, result.nextLink]); + return { done: false, value: result.value }; + } else { + this._next = null; + return { done: false, value: result.value }; + } + }, + }; } } -export interface IGraphQueryableCollection extends _GraphQueryableCollection { } -export const GraphQueryableCollection = graphInvokableFactory(_GraphQueryableCollection); + +export interface IGraphCollection extends _GraphCollection { } +export const GraphCollection = graphInvokableFactory(_GraphCollection); /** * Represents an instance that can be selected * */ -export class _GraphQueryableInstance extends _GraphQueryable { } +export class _GraphInstance extends _GraphQueryable { } + +export interface IGraphInstance extends IInvokable, IGraphQueryable { } +export const GraphInstance = graphInvokableFactory(_GraphInstance); + +export const graphGet = (o: IGraphQueryable, init?: RequestInit): Promise => { + return op(o, get, init); +}; + +export const graphPost = (o: IGraphQueryable, init?: RequestInit): Promise => { + return op(o, post, init); +}; + +export const graphDelete = (o: IGraphQueryable, init?: RequestInit): Promise => { + return op(o, del, init); +}; + +export const graphPatch = (o: IGraphQueryable, init?: RequestInit): Promise => { + return op(o, patch, init); +}; + +export const graphPut = (o: IGraphQueryable, init?: RequestInit): Promise => { + return op(o, put, init); +}; -export interface IGraphQueryableInstance extends IInvokable, IGraphQueryable { } -export const GraphQueryableInstance = graphInvokableFactory(_GraphQueryableInstance); diff --git a/packages/graph/groups/types.ts b/packages/graph/groups/types.ts index 43fae39d1..f8d7810af 100644 --- a/packages/graph/groups/types.ts +++ b/packages/graph/groups/types.ts @@ -1,8 +1,7 @@ import { Event as IEventType, Group as IGroupType } from "@microsoft/microsoft-graph-types"; import { body } from "@pnp/queryable"; -import { graphInvokableFactory } from "../graphqueryable.js"; +import { graphInvokableFactory, graphPost } from "../graphqueryable.js"; import { defaultPath, deleteable, IDeleteable, updateable, IUpdateable, getById, IGetById } from "../decorators.js"; -import { graphPost } from "../operations.js"; import { _DirectoryObject, _DirectoryObjects } from "../directory-objects/types.js"; export enum GroupType { diff --git a/packages/graph/index.ts b/packages/graph/index.ts index 572141f33..61ea18fd6 100644 --- a/packages/graph/index.ts +++ b/packages/graph/index.ts @@ -1,16 +1,6 @@ export { graphfi as graphfi, GraphFI as GraphFI } from "./fi.js"; -export { - IGraphQueryableCollection, - IGraphQueryableInstance, - GraphQueryable, - IGraphQueryable, - GraphQueryableCollection, - GraphQueryableInstance, - IGraphQueryableConstructor, -} from "./graphqueryable.js"; - -export * from "./operations.js"; +export * from "./graphqueryable.js"; export * from "./behaviors/consistency-level.js"; export * from "./behaviors/defaults.js"; diff --git a/packages/graph/insights/types.ts b/packages/graph/insights/types.ts index 9c2c050ef..1cd2b5e62 100644 --- a/packages/graph/insights/types.ts +++ b/packages/graph/insights/types.ts @@ -6,8 +6,8 @@ import { Entity as IEntityType, } from "@microsoft/microsoft-graph-types"; import { - _GraphQueryableInstance, - _GraphQueryableCollection, + _GraphInstance, + _GraphCollection, graphInvokableFactory, } from "../graphqueryable.js"; import { defaultPath, getById, IGetById } from "../decorators.js"; @@ -16,7 +16,7 @@ import { defaultPath, getById, IGetById } from "../decorators.js"; * Represents a insights entity */ @defaultPath("insights") -export class _Insights extends _GraphQueryableInstance { +export class _Insights extends _GraphInstance { public get trending(): ITrendingInsights { return TrendingInsights(this); @@ -36,7 +36,7 @@ export const Insights = graphInvokableFactory(_Insights); /** * Describes a Trending Insight instance */ -export class _TrendingInsight extends _GraphQueryableInstance { +export class _TrendingInsight extends _GraphInstance { public get resource(): IResource { return Resource(this); } @@ -50,14 +50,14 @@ export const TrendingInsight = graphInvokableFactory(_Trending */ @defaultPath("trending") @getById(TrendingInsight) -export class _TrendingInsights extends _GraphQueryableCollection {} +export class _TrendingInsights extends _GraphCollection {} export interface ITrendingInsights extends _TrendingInsights, IGetById {} export const TrendingInsights = graphInvokableFactory(_TrendingInsights); /** * Describes a Used Insight instance */ -export class _UsedInsight extends _GraphQueryableInstance { +export class _UsedInsight extends _GraphInstance { public get resource(): IResource { return Resource(this); } @@ -71,14 +71,14 @@ export const UsedInsight = graphInvokableFactory(_UsedInsight); */ @defaultPath("used") @getById(UsedInsight) -export class _UsedInsights extends _GraphQueryableCollection {} +export class _UsedInsights extends _GraphCollection {} export interface IUsedInsights extends _UsedInsights, IGetById {} export const UsedInsights = graphInvokableFactory(_UsedInsights); /** * Describes a Shared Insight instance */ -export class _SharedInsight extends _GraphQueryableInstance { +export class _SharedInsight extends _GraphInstance { public get resource(): IResource { return Resource(this); } @@ -92,7 +92,7 @@ export const SharedInsight = graphInvokableFactory(_SharedInsigh */ @defaultPath("shared") @getById(SharedInsight) -export class _SharedInsights extends _GraphQueryableCollection {} +export class _SharedInsights extends _GraphCollection {} export interface ISharedInsights extends _SharedInsights, IGetById {} export const SharedInsights = graphInvokableFactory(_SharedInsights); @@ -100,6 +100,6 @@ export const SharedInsights = graphInvokableFactory(_SharedInsi * Describes a Resource Entity instance */ @defaultPath("resource") -export class _Resource extends _GraphQueryableInstance {} +export class _Resource extends _GraphInstance {} export interface IResource extends _Resource { } export const Resource = graphInvokableFactory(_Resource); diff --git a/packages/graph/invitations/types.ts b/packages/graph/invitations/types.ts index 036e94d7b..7907733f5 100644 --- a/packages/graph/invitations/types.ts +++ b/packages/graph/invitations/types.ts @@ -1,14 +1,13 @@ import { body } from "@pnp/queryable"; import { Invitation as IInvitationType } from "@microsoft/microsoft-graph-types"; -import { _GraphQueryableCollection, graphInvokableFactory } from "../graphqueryable.js"; +import { _GraphCollection, graphInvokableFactory, graphPost } from "../graphqueryable.js"; import { defaultPath } from "../decorators.js"; -import { graphPost } from "../operations.js"; /** * Invitations */ @defaultPath("invitations") -export class _Invitations extends _GraphQueryableCollection { +export class _Invitations extends _GraphCollection { /** * Create a new Invitation via invitation manager. diff --git a/packages/graph/lists/drive.ts b/packages/graph/lists/drive.ts index 76277fdbb..84b2eb6f3 100644 --- a/packages/graph/lists/drive.ts +++ b/packages/graph/lists/drive.ts @@ -1,7 +1,7 @@ -import { _Drive } from "../drive/types.js"; +import { _Drive } from "../files/types.js"; import { List, IList } from "./types.js"; -declare module "../drive/types" { +declare module "../files/types" { interface _Drive { getList: () => Promise; } diff --git a/packages/graph/lists/types.ts b/packages/graph/lists/types.ts index 1e3ea85a2..48b5cb1fd 100644 --- a/packages/graph/lists/types.ts +++ b/packages/graph/lists/types.ts @@ -1,7 +1,6 @@ import { List as IListEntity } from "@microsoft/microsoft-graph-types"; -import { _GraphQueryableCollection, graphInvokableFactory, _GraphQueryableInstance } from "../graphqueryable.js"; +import { _GraphCollection, graphInvokableFactory, _GraphInstance, graphPost } from "../graphqueryable.js"; import { defaultPath, deleteable, IDeleteable, updateable, IUpdateable, getById, IGetById } from "../decorators.js"; -import { graphPost } from "../operations.js"; import { body } from "@pnp/queryable"; /** @@ -9,7 +8,7 @@ import { body } from "@pnp/queryable"; */ @deleteable() @updateable() -export class _List extends _GraphQueryableInstance {} +export class _List extends _GraphInstance { } export interface IList extends _List, IDeleteable, IUpdateable { } export const List = graphInvokableFactory(_List); @@ -19,7 +18,7 @@ export const List = graphInvokableFactory(_List); */ @defaultPath("lists") @getById(List) -export class _Lists extends _GraphQueryableCollection{ +export class _Lists extends _GraphCollection{ /** * Create a new list as specified in the request body. * diff --git a/packages/graph/members/types.ts b/packages/graph/members/types.ts index bae91f96a..19a56d72d 100644 --- a/packages/graph/members/types.ts +++ b/packages/graph/members/types.ts @@ -1,13 +1,12 @@ import { body } from "@pnp/queryable"; import { User as IMemberType } from "@microsoft/microsoft-graph-types"; -import { _GraphQueryableCollection, _GraphQueryableInstance, graphInvokableFactory } from "../graphqueryable.js"; +import { _GraphCollection, _GraphInstance, graphInvokableFactory, graphDelete, graphPost } from "../graphqueryable.js"; import { defaultPath, getById, IGetById } from "../decorators.js"; -import { graphDelete, graphPost } from "../operations.js"; /** * Member */ -export class _Member extends _GraphQueryableInstance { +export class _Member extends _GraphInstance { /** * Removes this Member */ @@ -23,7 +22,7 @@ export const Member = graphInvokableFactory(_Member); */ @defaultPath("members") @getById(Member) -export class _Members extends _GraphQueryableCollection { +export class _Members extends _GraphCollection { /** * Use this API to add a member to an Office 365 group, a security group or a mail-enabled security group through diff --git a/packages/graph/messages/types.ts b/packages/graph/messages/types.ts index 4dfb00683..342e544ce 100644 --- a/packages/graph/messages/types.ts +++ b/packages/graph/messages/types.ts @@ -1,11 +1,11 @@ import { Message as IMessageType, MailFolder as IMailFolderType, MailboxSettings as IMailboxSettingsType } from "@microsoft/microsoft-graph-types"; -import { _GraphQueryableInstance, _GraphQueryableCollection, graphInvokableFactory } from "../graphqueryable.js"; +import { _GraphInstance, _GraphCollection, graphInvokableFactory } from "../graphqueryable.js"; import { defaultPath, getById, addable, IGetById, IAddable, updateable, IUpdateable } from "../decorators.js"; /** * Message */ -export class _Message extends _GraphQueryableInstance { } +export class _Message extends _GraphInstance { } export interface IMessage extends _Message { } export const Message = graphInvokableFactory(_Message); @@ -15,14 +15,14 @@ export const Message = graphInvokableFactory(_Message); @defaultPath("messages") @getById(Message) @addable() -export class _Messages extends _GraphQueryableCollection { } +export class _Messages extends _GraphCollection { } export interface IMessages extends _Messages, IGetById, IAddable { } export const Messages = graphInvokableFactory(_Messages); /** * MailFolder */ -export class _MailFolder extends _GraphQueryableInstance { } +export class _MailFolder extends _GraphInstance { } export interface IMailFolder extends _MailFolder { } export const MailFolder = graphInvokableFactory(_MailFolder); @@ -32,7 +32,7 @@ export const MailFolder = graphInvokableFactory(_MailFolder); @defaultPath("mailFolders") @getById(MailFolder) @addable() -export class _MailFolders extends _GraphQueryableCollection { } +export class _MailFolders extends _GraphCollection { } export interface IMailFolders extends _MailFolders, IGetById, IAddable { } export const MailFolders = graphInvokableFactory(_MailFolders); @@ -41,6 +41,6 @@ export const MailFolders = graphInvokableFactory(_MailFolders); */ @defaultPath("mailboxSettings") @updateable() -export class _MailboxSettings extends _GraphQueryableInstance { } +export class _MailboxSettings extends _GraphInstance { } export interface IMailboxSettings extends _MailboxSettings, IUpdateable { } export const MailboxSettings = graphInvokableFactory(_MailboxSettings); diff --git a/packages/graph/messages/users.ts b/packages/graph/messages/users.ts index 0712770bd..281280c35 100644 --- a/packages/graph/messages/users.ts +++ b/packages/graph/messages/users.ts @@ -1,7 +1,7 @@ import { addProp, body } from "@pnp/queryable"; import { _User, User } from "../users/types.js"; import { IMessages, Messages, IMailboxSettings, MailboxSettings, IMailFolders, MailFolders, IMessage } from "./types.js"; -import { graphPost } from "../operations.js"; +import { graphPost } from "../graphqueryable.js"; declare module "../users/types" { interface _User { diff --git a/packages/graph/onenote/types.ts b/packages/graph/onenote/types.ts index 05ba06b03..491041a7c 100644 --- a/packages/graph/onenote/types.ts +++ b/packages/graph/onenote/types.ts @@ -1,20 +1,20 @@ import { body } from "@pnp/queryable"; import { Notebook as INotebookType, Onenote as IOnenoteType, OnenoteSection as ISectionType, OnenotePage as IOnenotePageType } from "@microsoft/microsoft-graph-types"; import { - GraphQueryableCollection, - _GraphQueryableInstance, - _GraphQueryableCollection, - IGraphQueryableCollection, + GraphCollection, + _GraphInstance, + _GraphCollection, + IGraphCollection, graphInvokableFactory, + graphPost, } from "../graphqueryable.js"; import { defaultPath, getById, IGetById } from "../decorators.js"; -import { graphPost } from "../operations.js"; /** * Represents a onenote entity */ @defaultPath("onenote") -export class _OneNote extends _GraphQueryableInstance { +export class _OneNote extends _GraphInstance { public get notebooks(): INotebooks { return Notebooks(this); @@ -24,8 +24,8 @@ export class _OneNote extends _GraphQueryableInstance { return Sections(this); } - public get pages(): IGraphQueryableCollection { - return GraphQueryableCollection(this, "pages"); + public get pages(): IGraphCollection { + return GraphCollection(this, "pages"); } } export interface IOneNote extends _OneNote {} @@ -36,7 +36,7 @@ export const OneNote = graphInvokableFactory(_OneNote); * Describes a notebook instance * */ -export class _Notebook extends _GraphQueryableInstance { +export class _Notebook extends _GraphInstance { public get sections(): ISections { return Sections(this); } @@ -50,7 +50,7 @@ export const Notebook = graphInvokableFactory(_Notebook); */ @defaultPath("notebooks") @getById(Notebook) -export class _Notebooks extends _GraphQueryableCollection { +export class _Notebooks extends _GraphCollection { /** * Create a new notebook as specified in the request body. * @@ -73,7 +73,7 @@ export const Notebooks = graphInvokableFactory(_Notebooks); /** * Describes a sections instance */ -export class _Section extends _GraphQueryableInstance { } +export class _Section extends _GraphInstance { } export interface ISection extends _Section { } export const Section = graphInvokableFactory(_Section); @@ -83,7 +83,7 @@ export const Section = graphInvokableFactory(_Section); */ @defaultPath("sections") @getById(Section) -export class _Sections extends _GraphQueryableCollection { +export class _Sections extends _GraphCollection { /** * Adds a new section * diff --git a/packages/graph/operations.ts b/packages/graph/operations.ts deleted file mode 100644 index d7c19f307..000000000 --- a/packages/graph/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { op, get, post, patch, del, put } from "@pnp/queryable"; -import { IGraphQueryable } from "./graphqueryable.js"; - -export const graphGet = (o: IGraphQueryable, init?: RequestInit): Promise => { - return op(o, get, init); -}; - -export const graphPost = (o: IGraphQueryable, init?: RequestInit): Promise => { - return op(o, post, init); -}; - -export const graphDelete = (o: IGraphQueryable, init?: RequestInit): Promise => { - return op(o, del, init); -}; - -export const graphPatch = (o: IGraphQueryable, init?: RequestInit): Promise => { - return op(o, patch, init); -}; - -export const graphPut = (o: IGraphQueryable, init?: RequestInit): Promise => { - return op(o, put, init); -}; diff --git a/packages/graph/operations/index.ts b/packages/graph/operations/index.ts new file mode 100644 index 000000000..0af3486dd --- /dev/null +++ b/packages/graph/operations/index.ts @@ -0,0 +1,7 @@ +import "./site.js"; +import "./list.js"; + +export { + IOperations, + Operations, +} from "./types.js"; diff --git a/packages/graph/operations/list.ts b/packages/graph/operations/list.ts new file mode 100644 index 000000000..69eccee9e --- /dev/null +++ b/packages/graph/operations/list.ts @@ -0,0 +1,14 @@ +import { addProp } from "@pnp/queryable"; +import { _List } from "../lists/types.js"; +import { IOperations, Operations } from "./types.js"; + +declare module "../lists/types" { + interface _List { + readonly operations: IOperations; + } + interface IList { + readonly operations: IOperations; + } +} + +addProp(_List, "operations", Operations); diff --git a/packages/graph/operations/site.ts b/packages/graph/operations/site.ts new file mode 100644 index 000000000..dca398b4d --- /dev/null +++ b/packages/graph/operations/site.ts @@ -0,0 +1,14 @@ +import { addProp } from "@pnp/queryable"; +import { _Site } from "../sites/types.js"; +import { IOperations, Operations } from "./types.js"; + +declare module "../sites/types" { + interface _Site { + readonly operations: IOperations; + } + interface ISite { + readonly operations: IOperations; + } +} + +addProp(_Site, "operations", Operations); diff --git a/packages/graph/operations/types.ts b/packages/graph/operations/types.ts new file mode 100644 index 000000000..7c12c4787 --- /dev/null +++ b/packages/graph/operations/types.ts @@ -0,0 +1,11 @@ +import { defaultPath } from "../decorators.js"; +import { graphInvokableFactory, _GraphCollection } from "../graphqueryable.js"; +import { Operation as IOperationType } from "@microsoft/microsoft-graph-types"; + +/** + * Operations + */ +@defaultPath("operations") +export class _Operations extends _GraphCollection {} +export interface IOperations extends _Operations { } +export const Operations = graphInvokableFactory(_Operations); diff --git a/packages/graph/outlook/types.ts b/packages/graph/outlook/types.ts index 362502fd5..606524491 100644 --- a/packages/graph/outlook/types.ts +++ b/packages/graph/outlook/types.ts @@ -1,4 +1,4 @@ -import { _GraphQueryableCollection, _GraphQueryableInstance, graphInvokableFactory } from "../graphqueryable.js"; +import { _GraphCollection, _GraphInstance, graphInvokableFactory } from "../graphqueryable.js"; import { OutlookUser as IOutlookType, OutlookCategory as IOutlookCategoryType } from "@microsoft/microsoft-graph-types"; import { defaultPath, deleteable, getById, IDeleteable, IGetById, IUpdateable, updateable } from "../decorators.js"; import { graphPost } from "@pnp/graph"; @@ -7,7 +7,7 @@ import { body } from "@pnp/queryable"; /** * Outlook */ -export class _Outlook extends _GraphQueryableInstance { +export class _Outlook extends _GraphInstance { public get masterCategories(): IMasterCategories { return MasterCategories(this); @@ -22,7 +22,7 @@ export const Outlook = graphInvokableFactory(_Outlook); */ @deleteable() @updateable() -export class _OutlookCategory extends _GraphQueryableInstance { } +export class _OutlookCategory extends _GraphInstance { } export interface IOutlookCategory extends _OutlookCategory, IUpdateable, IDeleteable { } export const OutlookCategory = graphInvokableFactory(_OutlookCategory); @@ -31,7 +31,7 @@ export const OutlookCategory = graphInvokableFactory(_OutlookC */ @defaultPath("masterCategories") @getById(OutlookCategory) -export class _MasterCategories extends _GraphQueryableCollection { +export class _MasterCategories extends _GraphCollection { /** * Adds a new event to the collection diff --git a/packages/graph/permissions/index.ts b/packages/graph/permissions/index.ts new file mode 100644 index 000000000..44f0a05ee --- /dev/null +++ b/packages/graph/permissions/index.ts @@ -0,0 +1,8 @@ +import "./site.js"; + +export { + IPermission, + IPermissions, + Permission, + Permissions, +} from "./types.js"; diff --git a/packages/graph/permissions/site.ts b/packages/graph/permissions/site.ts new file mode 100644 index 000000000..a293c6e24 --- /dev/null +++ b/packages/graph/permissions/site.ts @@ -0,0 +1,14 @@ +import { addProp } from "@pnp/queryable"; +import { _Site } from "../sites/types.js"; +import { IPermissions, Permissions } from "./types.js"; + +declare module "../sites/types" { + interface _Site { + readonly permissions: IPermissions; + } + interface ISite { + readonly permissions: IPermissions; + } +} + +addProp(_Site, "permissions", Permissions); diff --git a/packages/graph/permissions/types.ts b/packages/graph/permissions/types.ts new file mode 100644 index 000000000..ca5cddb95 --- /dev/null +++ b/packages/graph/permissions/types.ts @@ -0,0 +1,28 @@ +import { body } from "@pnp/queryable"; +import { IDeleteable, IGetById, IUpdateable, defaultPath, deleteable, getById, updateable } from "../decorators.js"; +import { graphInvokableFactory, _GraphCollection, _GraphInstance, graphPost } from "../graphqueryable.js"; +import { Permission as IPermissionType } from "@microsoft/microsoft-graph-types"; + +/** + * Permission + */ +@deleteable() +@updateable() +export class _Permission extends _GraphInstance {} +export interface IPermission extends _Permission, IUpdateable>, IDeleteable { } +export const Permission = graphInvokableFactory(_Permission); + +/** + * Permissions + */ +@defaultPath("permissions") +@getById(Permission) +export class _Permissions extends _GraphCollection { + + public add(permissions: Pick): Promise { + + return graphPost(this, body(permissions)); + } +} +export interface IPermissions extends _Permissions, IGetById { } +export const Permissions = graphInvokableFactory(_Permissions); diff --git a/packages/graph/photos/types.ts b/packages/graph/photos/types.ts index f4586c719..0fddcc423 100644 --- a/packages/graph/photos/types.ts +++ b/packages/graph/photos/types.ts @@ -1,11 +1,10 @@ -import { _GraphQueryableInstance, graphInvokableFactory } from "../graphqueryable.js"; +import { _GraphInstance, graphInvokableFactory, graphPatch } from "../graphqueryable.js"; import { BlobParse, BufferParse } from "@pnp/queryable"; import { Photo as IPhotoType } from "@microsoft/microsoft-graph-types"; import { defaultPath } from "../decorators.js"; -import { graphPatch } from "../operations.js"; @defaultPath("photo") -export class _Photo extends _GraphQueryableInstance { +export class _Photo extends _GraphInstance { /** * Gets the image bytes as a blob (browser) */ diff --git a/packages/graph/planner/types.ts b/packages/graph/planner/types.ts index c593c20e8..daf3f34c1 100644 --- a/packages/graph/planner/types.ts +++ b/packages/graph/planner/types.ts @@ -7,16 +7,15 @@ import { Planner as IPlannerType, } from "@microsoft/microsoft-graph-types"; import { body } from "@pnp/queryable"; -import { _GraphQueryableInstance, _GraphQueryableCollection, graphInvokableFactory } from "../graphqueryable.js"; +import { _GraphInstance, _GraphCollection, graphInvokableFactory, graphPost } from "../graphqueryable.js"; import { getById, IGetById, deleteableWithETag, IDeleteableWithETag, updateableWithETag, IUpdateableWithETag } from "../decorators.js"; -import { graphPost } from "../operations.js"; import { defaultPath } from "../decorators.js"; /** * Planner */ @defaultPath("planner") -export class _Planner extends _GraphQueryableInstance { +export class _Planner extends _GraphInstance { // Should Only be able to get by id, or else error occur public get plans(): IPlans { @@ -41,7 +40,7 @@ export const Planner = graphInvokableFactory(_Planner); */ @defaultPath("details") @updateableWithETag() -export class _PlanDetails extends _GraphQueryableInstance { } +export class _PlanDetails extends _GraphInstance { } export interface IPlanDetails extends _PlanDetails, IUpdateableWithETag { } export const PlanDetails = graphInvokableFactory(_PlanDetails); @@ -50,7 +49,7 @@ export const PlanDetails = graphInvokableFactory(_PlanDetails); */ @updateableWithETag() @deleteableWithETag() -export class _Plan extends _GraphQueryableInstance { +export class _Plan extends _GraphInstance { public get tasks(): ITasks { return Tasks(this); @@ -69,7 +68,7 @@ export const Plan = graphInvokableFactory(_Plan); @defaultPath("plans") @getById(Plan) -export class _Plans extends _GraphQueryableCollection { +export class _Plans extends _GraphCollection { /** * Create a new Planner Plan. * @@ -94,7 +93,7 @@ export const Plans = graphInvokableFactory(_Plans); */ @defaultPath("details") @updateableWithETag() -export class _TaskDetails extends _GraphQueryableInstance { } +export class _TaskDetails extends _GraphInstance { } export interface ITaskDetails extends _TaskDetails, IUpdateableWithETag { } export const TaskDetails = graphInvokableFactory(_TaskDetails); @@ -103,7 +102,7 @@ export const TaskDetails = graphInvokableFactory(_TaskDetails); */ @updateableWithETag() @deleteableWithETag() -export class _Task extends _GraphQueryableInstance { +export class _Task extends _GraphInstance { public get details(): ITaskDetails { return TaskDetails(this); } @@ -116,7 +115,7 @@ export const Task = graphInvokableFactory(_Task); */ @defaultPath("tasks") @getById(Task) -export class _Tasks extends _GraphQueryableCollection { +export class _Tasks extends _GraphCollection { /** * Create a new Planner Task. * @@ -156,7 +155,7 @@ export const Tasks = graphInvokableFactory(_Tasks); */ @updateableWithETag() @deleteableWithETag() -export class _Bucket extends _GraphQueryableInstance { +export class _Bucket extends _GraphInstance { public get tasks(): ITasks { return Tasks(this); } @@ -170,7 +169,7 @@ export const Bucket = graphInvokableFactory(_Bucket); */ @defaultPath("buckets") @getById(Bucket) -export class _Buckets extends _GraphQueryableCollection { +export class _Buckets extends _GraphCollection { /** * Create a new Bucket. * diff --git a/packages/graph/presets/all.ts b/packages/graph/presets/all.ts index a53002f4a..641972213 100644 --- a/packages/graph/presets/all.ts +++ b/packages/graph/presets/all.ts @@ -9,8 +9,9 @@ import "../insights/index.js"; import "../invitations/index.js"; import "../members/index.js"; import "../messages/index.js"; -import "../drive/index.js"; +import "../files/index.js"; import "../onenote/index.js"; +import "../operations/index.js"; import "../photos/index.js"; import "../planner/index.js"; import "../search/index.js"; @@ -30,8 +31,9 @@ export * from "../insights/index.js"; export * from "../invitations/index.js"; export * from "../members/index.js"; export * from "../messages/index.js"; -export * from "../drive/index.js"; +export * from "../files/index.js"; export * from "../onenote/index.js"; +export * from "../operations/index.js"; export * from "../photos/index.js"; export * from "../planner/index.js"; export * from "../search/index.js"; diff --git a/packages/graph/search/types.ts b/packages/graph/search/types.ts index ece1ccf2f..7e629311e 100644 --- a/packages/graph/search/types.ts +++ b/packages/graph/search/types.ts @@ -1,14 +1,13 @@ import { SearchRequest as ISearchRequestType, SearchResponse as ISearchResponseType } from "@microsoft/microsoft-graph-types"; import { body } from "@pnp/queryable"; import { defaultPath } from "../decorators.js"; -import { GraphInit, graphInvokableFactory, _GraphQueryableInstance } from "../graphqueryable.js"; -import { graphPost } from "../operations.js"; +import { GraphInit, graphInvokableFactory, _GraphInstance, graphPost } from "../graphqueryable.js"; /** * Search */ @defaultPath("search") -export class _Search extends _GraphQueryableInstance { +export class _Search extends _GraphInstance { public executeQuery(request: { requests: ISearchRequestType[] }): Promise { return graphPost(Search(this, "query"), body(request)); diff --git a/packages/graph/shares/types.ts b/packages/graph/shares/types.ts index aed1aa7ba..10083be78 100644 --- a/packages/graph/shares/types.ts +++ b/packages/graph/shares/types.ts @@ -1,13 +1,13 @@ import { defaultPath } from "../decorators.js"; -import { graphInvokableFactory, _GraphQueryableCollection, _GraphQueryableInstance } from "../graphqueryable.js"; +import { graphInvokableFactory, _GraphCollection, _GraphInstance } from "../graphqueryable.js"; import { SharedDriveItem as ISharedDriveItem } from "@microsoft/microsoft-graph-types"; -import { DriveItem, IDriveItem } from "../drive/types.js"; +import { DriveItem, IDriveItem } from "../files/types.js"; /** * Shares */ @defaultPath("shares") -export class _Shares extends _GraphQueryableCollection { +export class _Shares extends _GraphCollection { /** * Gets a share by share id or encoded url @@ -33,7 +33,7 @@ export const Shares = graphInvokableFactory(_Shares); /** * Share */ -export class _Share extends _GraphQueryableInstance { +export class _Share extends _GraphInstance { /** * Access the driveItem associated with this shared file diff --git a/packages/graph/sites/index.ts b/packages/graph/sites/index.ts index a6298e0f2..7ef19395a 100644 --- a/packages/graph/sites/index.ts +++ b/packages/graph/sites/index.ts @@ -2,6 +2,7 @@ import { GraphFI } from "../fi.js"; import { Sites, ISites } from "./types.js"; import "./group.js"; +import "./user.js"; export { ISites, diff --git a/packages/graph/sites/types.ts b/packages/graph/sites/types.ts index 0bdee042c..9fc136f15 100644 --- a/packages/graph/sites/types.ts +++ b/packages/graph/sites/types.ts @@ -1,12 +1,14 @@ +import { combine } from "@pnp/core"; import { defaultPath } from "../decorators.js"; -import { graphInvokableFactory, _GraphQueryableCollection, _GraphQueryableInstance } from "../graphqueryable.js"; +import { graphInvokableFactory, _GraphCollection, _GraphInstance, graphPost } from "../graphqueryable.js"; import { Site as ISiteType } from "@microsoft/microsoft-graph-types"; +import { body } from "@pnp/queryable"; /** * Sites */ @defaultPath("sites") -export class _Sites extends _GraphQueryableCollection { +export class _Sites extends _GraphCollection { /** * Gets the team site for the group */ @@ -24,8 +26,18 @@ export class _Sites extends _GraphQueryableCollection { * @param siteUrl: string, the server relative url of the site e.g. "/sites/teamsite1" * @returns ISite */ - public getByUrl(hostname: string, siteUrl: string): ISite { - return Site(this, `${hostname}:${siteUrl}:`); + public async getByUrl(hostname: string, siteUrl: string): Promise { + + return Site(this, `${hostname}:${combine("/", siteUrl)}:`).rebase(); + } + + /** + * List sites across geographies in an organization. This API can also be used to enumerate all sites in a non-multi-geo tenant. + * + * @returns A ISites collection which can be used with async iteration to page through the collection + */ + public getAllSites(): ISites { + return Sites(this, "getAllSites"); } } export interface ISites extends _Sites { } @@ -34,12 +46,51 @@ export const Sites = graphInvokableFactory(_Sites); /** * Site */ -export class _Site extends _GraphQueryableInstance { +export class _Site extends _GraphInstance { public get sites(): ISites { return Sites(this); } + + /** + * Rebases this ISite instances to ensure it is of the pattern /sites/{site id} regardless of how it was first retrieved + */ + public async rebase(): Promise { + const siteInfo = await Site(this).select("id")(); + return Site([this, `sites/${siteInfo.id}`]); + } } export interface ISite extends _Site { } export const Site = graphInvokableFactory(_Site); +/** + * Followed Sites + * + * Note: At this time listing a user's followed sites is not supported with app-only permissions + */ +@defaultPath("followedsites") +export class _FollowedSites extends _GraphCollection { + + /** + * Adds site(s) to the user's collection of followed sites + * + * @param siteIds The collection of site ids to add + * @returns Site info for the newly followed sites + */ + public add(...siteIds: string[]): Promise { + + return graphPost(FollowedSites(this, "add"), body({ value: siteIds.map(id => ({ id })) })); + } + + /** + * REmoves site(s) to the user's collection of followed sites + * + * @param siteIds The collection of site ids to remove + */ + public remove(...siteIds: string[]): Promise { + + return graphPost(FollowedSites(this, "remove"), body({ value: siteIds.map(id => ({ id })) })); + } +} +export interface IFollowedSites extends _FollowedSites { } +export const FollowedSites = graphInvokableFactory(_FollowedSites); diff --git a/packages/graph/sites/user.ts b/packages/graph/sites/user.ts new file mode 100644 index 000000000..12b4e6426 --- /dev/null +++ b/packages/graph/sites/user.ts @@ -0,0 +1,14 @@ +import { addProp } from "@pnp/queryable"; +import { _User } from "../users/types.js"; +import { IFollowedSites, FollowedSites } from "./types.js"; + +declare module "../users/types" { + interface _User { + followedSites: IFollowedSites; + } + interface IUser { + followedSites: IFollowedSites; + } +} + +addProp(_User, "followedSites", FollowedSites); diff --git a/packages/graph/subscriptions/types.ts b/packages/graph/subscriptions/types.ts index 417c6182f..a69abb873 100644 --- a/packages/graph/subscriptions/types.ts +++ b/packages/graph/subscriptions/types.ts @@ -1,15 +1,14 @@ -import { _GraphQueryableInstance, _GraphQueryableCollection, graphInvokableFactory } from "../graphqueryable.js"; +import { _GraphInstance, _GraphCollection, graphInvokableFactory, graphPost } from "../graphqueryable.js"; import { body } from "@pnp/queryable"; import { Subscription as ISubscriptionType } from "@microsoft/microsoft-graph-types"; import { defaultPath, deleteable, IDeleteable, IUpdateable, updateable, getById, IGetById } from "../decorators.js"; -import { graphPost } from "../operations.js"; /** * Subscription */ @deleteable() @updateable() -export class _Subscription extends _GraphQueryableInstance { } +export class _Subscription extends _GraphInstance { } export interface ISubscription extends _Subscription, IDeleteable, IUpdateable { } export const Subscription = graphInvokableFactory(_Subscription); @@ -18,7 +17,7 @@ export const Subscription = graphInvokableFactory(_Subscription); */ @defaultPath("subscriptions") @getById(Subscription) -export class _Subscriptions extends _GraphQueryableCollection { +export class _Subscriptions extends _GraphCollection { /** * Create a new Subscription. * diff --git a/packages/graph/teams/index.ts b/packages/graph/teams/index.ts index 8bfb28420..dbc29897a 100644 --- a/packages/graph/teams/index.ts +++ b/packages/graph/teams/index.ts @@ -3,7 +3,7 @@ import { GraphFI } from "../fi.js"; import { _Group, Group } from "../groups/types.js"; import { ITeamCreateResult, ITeam, Team, ITeams, Teams } from "./types.js"; import { Team as ITeamType } from "@microsoft/microsoft-graph-types"; -import { graphPut } from "../operations.js"; +import { graphPut } from "../graphqueryable.js"; import "./users.js"; diff --git a/packages/graph/teams/types.ts b/packages/graph/teams/types.ts index 86196c8b7..7ac7c401c 100644 --- a/packages/graph/teams/types.ts +++ b/packages/graph/teams/types.ts @@ -1,7 +1,6 @@ -import { _GraphQueryableInstance, _GraphQueryableCollection, graphInvokableFactory, GraphQueryableInstance } from "../graphqueryable.js"; +import { _GraphInstance, _GraphCollection, graphInvokableFactory, GraphInstance, graphPost } from "../graphqueryable.js"; import { body, HeaderParse } from "@pnp/queryable"; import { updateable, IUpdateable, getById, IGetById, deleteable, IDeleteable } from "../decorators.js"; -import { graphPost } from "../operations.js"; import { defaultPath } from "../decorators.js"; import { Team as ITeamType, @@ -16,7 +15,7 @@ import { */ @defaultPath("team") @updateable() -export class _Team extends _GraphQueryableInstance { +export class _Team extends _GraphInstance { public get primaryChannel(): IChannel { return Channel(this, "primaryChannel"); @@ -95,7 +94,7 @@ export class _Team extends _GraphQueryableInstance { } public getOperationById(id: string): Promise { - return GraphQueryableInstance(this, `operations/${id}`)(); + return GraphInstance(this, `operations/${id}`)(); } } export interface ITeam extends _Team, IUpdateable { } @@ -106,7 +105,7 @@ export const Team = graphInvokableFactory(_Team); */ @defaultPath("teams") @getById(Team) -export class _Teams extends _GraphQueryableCollection { +export class _Teams extends _GraphCollection { public async create(team: ITeamType): Promise { const creator = Teams(this, null).using(HeaderParse()); @@ -130,7 +129,7 @@ export const Teams = graphInvokableFactory(_Teams); /** * Channel */ -export class _Channel extends _GraphQueryableInstance { +export class _Channel extends _GraphInstance { public get tabs(): ITabs { return Tabs(this); } @@ -147,7 +146,7 @@ export const Channel = graphInvokableFactory(_Channel); */ @defaultPath("channels") @getById(Channel) -export class _Channels extends _GraphQueryableCollection { +export class _Channels extends _GraphCollection { /** * Creates a new Channel in the Team @@ -176,7 +175,7 @@ export const Channels = graphInvokableFactory(_Channels); /** * Channel */ -export class _Message extends _GraphQueryableInstance { } +export class _Message extends _GraphInstance { } export interface IMessage extends _Message { } export const Message = graphInvokableFactory(_Message); @@ -185,7 +184,7 @@ export const Message = graphInvokableFactory(_Message); */ @defaultPath("messages") @getById(Message) -export class _Messages extends _GraphQueryableCollection { +export class _Messages extends _GraphCollection { /** * Creates a new Channel in the Team @@ -217,7 +216,7 @@ export const Messages = graphInvokableFactory(_Messages); @defaultPath("tab") @updateable() @deleteable() -export class _Tab extends _GraphQueryableInstance { } +export class _Tab extends _GraphInstance { } export interface ITab extends _Tab, IUpdateable, IDeleteable { } export const Tab = graphInvokableFactory(_Tab); @@ -226,7 +225,7 @@ export const Tab = graphInvokableFactory(_Tab); */ @defaultPath("tabs") @getById(Tab) -export class _Tabs extends _GraphQueryableCollection { +export class _Tabs extends _GraphCollection { /** * Adds a tab to the channel @@ -292,7 +291,7 @@ export interface ITeamCreateResult { * InstalledApp */ @deleteable() -export class _InstalledApp extends _GraphQueryableInstance { +export class _InstalledApp extends _GraphInstance { public upgrade(): Promise { return graphPost(InstalledApp(this, "upgrade")); } @@ -305,7 +304,7 @@ export const InstalledApp = graphInvokableFactory(_InstalledApp); */ @defaultPath("installedApps") @getById(InstalledApp) -export class _InstalledApps extends _GraphQueryableCollection { +export class _InstalledApps extends _GraphCollection { /** * Adds an installed app to the collection diff --git a/packages/sp/appcatalog/types.ts b/packages/sp/appcatalog/types.ts index 4cb8386d1..d40a27443 100644 --- a/packages/sp/appcatalog/types.ts +++ b/packages/sp/appcatalog/types.ts @@ -4,8 +4,8 @@ import { _SPInstance, ISPQueryable, SPCollection, + spPost, } from "../spqueryable.js"; -import { spPost } from "../operations.js"; import { odataUrlFrom } from "../utils/odata-url-from.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { File, IFile } from "../files/types.js"; diff --git a/packages/sp/attachments/types.ts b/packages/sp/attachments/types.ts index 048f6d051..e53157108 100644 --- a/packages/sp/attachments/types.ts +++ b/packages/sp/attachments/types.ts @@ -1,13 +1,13 @@ import { headers } from "@pnp/queryable"; import { defaultPath } from "../decorators.js"; import { ReadableFile } from "../files/readable-file.js"; -import { spPost } from "../operations.js"; import { encodePath } from "../utils/encode-path-str.js"; import { IDeleteableWithETag, _SPCollection, spInvokableFactory, deleteableWithETag, + spPost, } from "../spqueryable.js"; @defaultPath("AttachmentFiles") diff --git a/packages/sp/batching.ts b/packages/sp/batching.ts index bad455769..5b3d4f025 100644 --- a/packages/sp/batching.ts +++ b/packages/sp/batching.ts @@ -1,7 +1,6 @@ import { getGUID, isUrlAbsolute, combine, CopyFrom, TimelinePipe, isFunc, hOP } from "@pnp/core"; import { parseBinderWithErrorCheck, Queryable } from "@pnp/queryable"; -import { spPost } from "./operations.js"; -import { ISPQueryable, _SPQueryable } from "./spqueryable.js"; +import { ISPQueryable, _SPQueryable, spPost } from "./spqueryable.js"; import { spfi, SPFI } from "./fi.js"; import { Web, IWeb, _Web } from "./webs/types.js"; diff --git a/packages/sp/behaviors/request-digest.ts b/packages/sp/behaviors/request-digest.ts index 4bbf74d0e..f90a70fa2 100644 --- a/packages/sp/behaviors/request-digest.ts +++ b/packages/sp/behaviors/request-digest.ts @@ -1,8 +1,7 @@ import { combine, dateAdd, hOP, isFunc, objectDefinedNotNull, TimelinePipe } from "@pnp/core"; import { JSONParse, Queryable } from "@pnp/queryable"; import { extractWebUrl } from "../utils/extract-web-url.js"; -import { ISPQueryable, SPQueryable } from "../spqueryable.js"; -import { spPost } from "../operations.js"; +import { ISPQueryable, SPQueryable, spPost } from "../spqueryable.js"; import { BatchNever } from "../batching.js"; interface IDigestInfo { diff --git a/packages/sp/behaviors/spfx.ts b/packages/sp/behaviors/spfx.ts index d5e64aba6..b680bacb1 100644 --- a/packages/sp/behaviors/spfx.ts +++ b/packages/sp/behaviors/spfx.ts @@ -22,8 +22,23 @@ export interface ISPFXContext { }; } +class SPFxTokenNullOrUndefinedError extends Error { + + constructor(behaviorName: string) { + super(`SPFx Context supplied to ${behaviorName} Behavior is null or undefined.`); + } + + public static check(behaviorName: string, context?: ISPFXContext): void { + if (typeof context === "undefined" || context === null) { + throw new SPFxTokenNullOrUndefinedError(behaviorName); + } + } +} + export function SPFxToken(context: ISPFXContext): TimelinePipe { + SPFxTokenNullOrUndefinedError.check("SPFxToken", context); + return (instance: Queryable) => { instance.on.auth.replace(async function (url: URL, init: RequestInit) { @@ -43,6 +58,8 @@ export function SPFxToken(context: ISPFXContext): TimelinePipe { export function SPFx(context: ISPFXContext): TimelinePipe { + SPFxTokenNullOrUndefinedError.check("SPFx", context); + return (instance: Queryable) => { instance.using( diff --git a/packages/sp/clientside-pages/types.ts b/packages/sp/clientside-pages/types.ts index ae6bf4eaf..e90613520 100644 --- a/packages/sp/clientside-pages/types.ts +++ b/packages/sp/clientside-pages/types.ts @@ -2,13 +2,12 @@ import { body, headers } from "@pnp/queryable"; import { getGUID, hOP, stringIsNullOrEmpty, objectDefinedNotNull, combine, isUrlAbsolute, isArray } from "@pnp/core"; import { IFile, IFileInfo } from "../files/types.js"; import { Item, IItem } from "../items/types.js"; -import { _SPQueryable, SPQueryable, SPCollection, SPInit } from "../spqueryable.js"; +import { _SPQueryable, SPQueryable, SPCollection, SPInit, spPost } from "../spqueryable.js"; import { List } from "../lists/types.js"; import { odataUrlFrom } from "../utils/odata-url-from.js"; import { Web, IWeb } from "../webs/types.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { Site } from "../sites/types.js"; -import { spPost } from "../operations.js"; import { getNextOrder, reindex } from "./funcs.js"; import "../files/web.js"; import "../comments/item.js"; diff --git a/packages/sp/clientside-pages/web.ts b/packages/sp/clientside-pages/web.ts index fe5502fe8..b0b4bd325 100644 --- a/packages/sp/clientside-pages/web.ts +++ b/packages/sp/clientside-pages/web.ts @@ -9,8 +9,7 @@ import { IRepostPage, ClientsideWebpart, } from "./types.js"; -import { SPCollection, SPInstance } from "../spqueryable.js"; -import { spPost } from "../operations.js"; +import { SPCollection, SPInstance, spPost } from "../spqueryable.js"; import { body } from "@pnp/queryable"; import { extractWebUrl } from "@pnp/sp"; diff --git a/packages/sp/column-defaults/list.ts b/packages/sp/column-defaults/list.ts index af4a283a7..44a3ec998 100644 --- a/packages/sp/column-defaults/list.ts +++ b/packages/sp/column-defaults/list.ts @@ -4,7 +4,7 @@ import { Folder } from "../folders/types.js"; import { IFieldDefault } from "./types.js"; import { IResourcePath } from "../utils/to-resource-path.js"; import { combine, isArray } from "@pnp/core"; -import { spPost } from "../operations.js"; +import { spPost } from "../spqueryable.js"; import { SPCollection } from "../presets/all.js"; import { encodePath } from "../utils/encode-path-str.js"; diff --git a/packages/sp/comments/clientside-page.ts b/packages/sp/comments/clientside-page.ts index c84504cdb..b2db9d5e7 100644 --- a/packages/sp/comments/clientside-page.ts +++ b/packages/sp/comments/clientside-page.ts @@ -1,8 +1,7 @@ import { _ClientsidePage } from "../clientside-pages/types.js"; import { ICommentInfo, IComment, ILikedByInformation } from "./types.js"; import { IItemUpdateResult, Item } from "../items/index.js"; -import { spPost } from "../operations.js"; -import { SPQueryable } from "../spqueryable.js"; +import { SPQueryable, spPost } from "../spqueryable.js"; declare module "../clientside-pages/types" { interface _ClientsidePage { diff --git a/packages/sp/comments/item.ts b/packages/sp/comments/item.ts index 19ef3e253..f81109471 100644 --- a/packages/sp/comments/item.ts +++ b/packages/sp/comments/item.ts @@ -1,10 +1,9 @@ import { addProp } from "@pnp/queryable"; import { _Item, Item } from "../items/types.js"; import { Comments, IComments, ILikeData, ILikedByInformation, RatingValues } from "./types.js"; -import { spPost } from "../operations.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { combine } from "@pnp/core"; -import { SPQueryable } from "../spqueryable.js"; +import { SPQueryable, spPost } from "../spqueryable.js"; declare module "../items/types" { interface _Item { diff --git a/packages/sp/comments/types.ts b/packages/sp/comments/types.ts index b793c6305..e9c859ea6 100644 --- a/packages/sp/comments/types.ts +++ b/packages/sp/comments/types.ts @@ -3,10 +3,11 @@ import { _SPCollection, spInvokableFactory, _SPInstance, + spDelete, + spPost, } from "../spqueryable.js"; import { odataUrlFrom } from "../utils/odata-url-from.js"; import { body } from "@pnp/queryable"; -import { spDelete, spPost } from "../operations.js"; @defaultPath("comments") export class _Comments extends _SPCollection { diff --git a/packages/sp/content-types/types.ts b/packages/sp/content-types/types.ts index 76ba1c689..6b029e6e1 100644 --- a/packages/sp/content-types/types.ts +++ b/packages/sp/content-types/types.ts @@ -7,9 +7,10 @@ import { ISPCollection, deleteable, IDeleteable, + spPost, + spPostMerge, } from "../spqueryable.js"; import { defaultPath } from "../decorators.js"; -import { spPost, spPostMerge } from "../operations.js"; @defaultPath("contenttypes") export class _ContentTypes extends _SPCollection { diff --git a/packages/sp/context-info/index.ts b/packages/sp/context-info/index.ts index 6b7194a50..ac06cfd01 100644 --- a/packages/sp/context-info/index.ts +++ b/packages/sp/context-info/index.ts @@ -1,6 +1,5 @@ import { hOP } from "@pnp/core"; -import { spPost } from "../operations.js"; -import { SPQueryable, _SPQueryable } from "../spqueryable.js"; +import { SPQueryable, _SPQueryable, spPost } from "../spqueryable.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; declare module "../spqueryable" { diff --git a/packages/sp/favorites/types.ts b/packages/sp/favorites/types.ts index 74ef2507a..b8e21106e 100644 --- a/packages/sp/favorites/types.ts +++ b/packages/sp/favorites/types.ts @@ -1,7 +1,6 @@ import { defaultPath } from "../decorators.js"; -import { _SPInstance, spInvokableFactory, _SPCollection, SPInit } from "../spqueryable.js"; +import { _SPInstance, spInvokableFactory, _SPCollection, SPInit, spPost } from "../spqueryable.js"; import { hOP } from "@pnp/core"; -import { spPost } from "../operations.js"; import { body } from "@pnp/queryable"; import { SharepointIds, ResourceVisualization } from "@microsoft/microsoft-graph-types"; diff --git a/packages/sp/features/types.ts b/packages/sp/features/types.ts index e98fb8abb..661249f5c 100644 --- a/packages/sp/features/types.ts +++ b/packages/sp/features/types.ts @@ -3,9 +3,9 @@ import { _SPInstance, _SPCollection, spInvokableFactory, + spPost, } from "../spqueryable.js"; import { defaultPath } from "../decorators.js"; -import { spPost } from "../operations.js"; @defaultPath("features") export class _Features extends _SPCollection { diff --git a/packages/sp/fields/types.ts b/packages/sp/fields/types.ts index 3b801afb6..2479af899 100644 --- a/packages/sp/fields/types.ts +++ b/packages/sp/fields/types.ts @@ -5,9 +5,10 @@ import { deleteable, spInvokableFactory, IDeleteable, + spPost, + spPostMerge, } from "../spqueryable.js"; import { defaultPath } from "../decorators.js"; -import { spPost, spPostMerge } from "../operations.js"; import { metadata } from "../utils/metadata.js"; @defaultPath("fields") diff --git a/packages/sp/files/types.ts b/packages/sp/files/types.ts index e5c9d8026..13b978315 100644 --- a/packages/sp/files/types.ts +++ b/packages/sp/files/types.ts @@ -10,11 +10,12 @@ import { ISPQueryable, deleteable, IDeleteable, + spPost, + spGet, } from "../spqueryable.js"; import { Item, IItem } from "../items/index.js"; import { odataUrlFrom } from "../utils/odata-url-from.js"; import { defaultPath } from "../decorators.js"; -import { spPost, spGet } from "../operations.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { toResourcePath } from "../utils/to-resource-path.js"; import { ISiteUserProps } from "../site-users/types.js"; diff --git a/packages/sp/folders/types.ts b/packages/sp/folders/types.ts index 323375171..abb637cb1 100644 --- a/packages/sp/folders/types.ts +++ b/packages/sp/folders/types.ts @@ -9,11 +9,12 @@ import { ISPInstance, IDeleteableWithETag, ISPQueryable, + spPost, + spPostMerge, } from "../spqueryable.js"; import { odataUrlFrom } from "../utils/odata-url-from.js"; import { IItem, Item } from "../items/types.js"; import { defaultPath } from "../decorators.js"; -import { spPost, spPostMerge } from "../operations.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { toResourcePath, IResourcePath } from "../utils/to-resource-path.js"; import { encodePath } from "../utils/encode-path-str.js"; diff --git a/packages/sp/groupsitemanager/types.ts b/packages/sp/groupsitemanager/types.ts index f3a2a35f9..e6f205aed 100644 --- a/packages/sp/groupsitemanager/types.ts +++ b/packages/sp/groupsitemanager/types.ts @@ -1,5 +1,6 @@ import { body, BufferParse } from "@pnp/queryable"; -import { _SPInstance, defaultPath, spPost, spInvokableFactory, ISPQueryable, spGet } from "@pnp/sp"; +import { _SPInstance, spPost, spInvokableFactory, ISPQueryable, spGet } from "../spqueryable.js"; +import { defaultPath } from "../decorators.js"; @defaultPath("_api/groupsitemanager") class _GroupSiteManager extends _SPInstance> { diff --git a/packages/sp/hubsites/site.ts b/packages/sp/hubsites/site.ts index 3cc4647cd..5be378797 100644 --- a/packages/sp/hubsites/site.ts +++ b/packages/sp/hubsites/site.ts @@ -1,5 +1,5 @@ import { _Site, Site } from "../sites/types.js"; -import { spPost } from "../operations.js"; +import { spPost } from "../spqueryable.js"; declare module "../sites/types" { interface _Site { diff --git a/packages/sp/hubsites/web.ts b/packages/sp/hubsites/web.ts index 4383e0568..7d409aebc 100644 --- a/packages/sp/hubsites/web.ts +++ b/packages/sp/hubsites/web.ts @@ -1,6 +1,6 @@ import { _Web, Web } from "../webs/types.js"; import { IHubSiteWebData } from "./types.js"; -import { spPost } from "../operations.js"; +import { spPost } from "../spqueryable.js"; declare module "../webs/types" { interface _Web { diff --git a/packages/sp/index.ts b/packages/sp/index.ts index 484493868..188a5bd3d 100644 --- a/packages/sp/index.ts +++ b/packages/sp/index.ts @@ -2,8 +2,6 @@ export * from "./spqueryable.js"; export * from "./decorators.js"; -export * from "./operations.js"; - export { SPFI, spfi, diff --git a/packages/sp/items/get-all.ts b/packages/sp/items/get-all.ts deleted file mode 100644 index 194e77fdf..000000000 --- a/packages/sp/items/get-all.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { InjectHeaders } from "@pnp/queryable"; -import { _Items, Items, PagedItemCollection } from "./types.js"; - -declare module "./types" { - interface _Items { - getAll(requestSize?: number, acceptHeader?: string): Promise; - } - /** - * Gets all the items in a list, regardless of count. Does not support batching or caching - * - * @param requestSize Number of items to return in each request (Default: 2000) - * @param acceptHeader Allows for setting the value of the Accept header for SP 2013 support - */ - interface IItems { - getAll(requestSize?: number, acceptHeader?: string): Promise; - } -} - -_Items.prototype.getAll = async function (this: _Items, requestSize = 2000, acceptHeader = "application/json;odata=nometadata"): Promise { - - // this will be used for the actual query - // and we set no metadata here to try and reduce traffic - const items = Items(this, "").top(requestSize).using(InjectHeaders({ - "Accept": acceptHeader, - })); - - // let's copy over the odata query params that can be applied - // $top - allow setting the page size this way (override what we did above) - // $select - allow picking the return fields (good behavior) - // $filter - allow setting a filter, though this may fail for large lists - // $expand - allow expanding fields for filter/select support - this.query.forEach((v: string, k: string) => { - if (/^\$select|filter|top|expand$/i.test(k)) { - items.query.set(k, v); - } - }); - - // this will eventually hold the items we return - const itemsCollector: T[] = []; - - // action that will gather up our results recursively - const gatherer = (last: PagedItemCollection) => { - - // collect that set of results - itemsCollector.push(...last.results); - - // if we have more, repeat - otherwise resolve with the collected items - return last.hasNext ? last.getNext().then(gatherer) : itemsCollector; - }; - - return items.getPaged().then(gatherer); -}; diff --git a/packages/sp/items/index.ts b/packages/sp/items/index.ts index fd9563fe2..d878c1601 100644 --- a/packages/sp/items/index.ts +++ b/packages/sp/items/index.ts @@ -12,7 +12,6 @@ export { IItemAddResult, IItemUpdateResult, IItemUpdateResultData, - PagedItemCollection, IItemDeleteParams, IItemParentInfos, } from "./types.js"; diff --git a/packages/sp/items/types.ts b/packages/sp/items/types.ts index af556e6a9..a1c33fa35 100644 --- a/packages/sp/items/types.ts +++ b/packages/sp/items/types.ts @@ -8,14 +8,15 @@ import { ISPQueryable, SPInstance, ISPInstance, + SPCollection, + spPost, } from "../spqueryable.js"; -import { hOP } from "@pnp/core"; +import { hOP, objectDefinedNotNull } from "@pnp/core"; import { extractWebUrl } from "@pnp/sp"; import { IListItemFormUpdateValue, List } from "../lists/types.js"; import { body, headers, parseBinderWithErrorCheck, parseODataJSON } from "@pnp/queryable"; import { IList } from "../lists/index.js"; import { defaultPath } from "../decorators.js"; -import { spPost } from "../operations.js"; import { IResourcePath } from "../utils/to-resource-path.js"; /** @@ -23,7 +24,7 @@ import { IResourcePath } from "../utils/to-resource-path.js"; * */ @defaultPath("items") -export class _Items extends _SPCollection { +export class _Items extends _SPCollection { /** * Gets an Item by id @@ -59,12 +60,50 @@ export class _Items extends _SPCollection { return this; } - /** - * Gets a collection designed to aid in paging through data - * - */ - public getPaged(): Promise> { - return this.using(PagedItemParser(this))(); + public [Symbol.asyncIterator]() { + + const q = SPCollection(this).using(parseBinderWithErrorCheck(async (r) => { + + const json = await r.json(); + const nextUrl = hOP(json, "d") && hOP(json.d, "__next") ? json.d.__next : json["odata.nextLink"]; + + return >{ + hasNext: typeof nextUrl === "string" && nextUrl.length > 0, + nextLink: nextUrl, + value: parseODataJSON(json), + }; + })); + + const queryParams = ["$top", "$select", "$expand", "$filter", "$orderby", "$skiptoken"]; + + for (let i = 0; i < queryParams.length; i++) { + const param = this.query.get(queryParams[i]); + if (objectDefinedNotNull(param)) { + q.query.set(queryParams[i], param); + } + } + + return >{ + + _next: q, + + async next() { + + if (this._next === null) { + return { done: true, value: undefined }; + } + + const result: IPagedResult = await this._next(); + + if (result.hasNext) { + this._next = SPCollection([this._next, result.nextLink]); + return { done: false, value: result.value }; + } else { + this._next = null; + return { done: false, value: result.value }; + } + }, + }; } /** @@ -311,41 +350,10 @@ export class _ItemVersion extends _SPInstance { export interface IItemVersion extends _ItemVersion, IDeleteableWithETag { } export const ItemVersion = spInvokableFactory(_ItemVersion); -/** - * Provides paging functionality for list items - */ -export class PagedItemCollection { - - constructor(private parent: _Items, private nextUrl: string, public results: T) { } - - /** - * If true there are more results available in the set, otherwise there are not - */ - public get hasNext(): boolean { - return typeof this.nextUrl === "string" && this.nextUrl.length > 0; - } - - /** - * Gets the next set of results, or resolves to null if no results are available - */ - public async getNext(): Promise | null> { - - if (this.hasNext) { - const items = Items([this.parent, this.nextUrl], ""); - return items.getPaged(); - } - - return null; - } -} - -function PagedItemParser(parent: _Items) { - - return parseBinderWithErrorCheck(async (r) => { - const json = await r.json(); - const nextUrl = hOP(json, "d") && hOP(json.d, "__next") ? json.d.__next : json["odata.nextLink"]; - return new PagedItemCollection(parent, nextUrl, parseODataJSON(json)); - }); +export interface IPagedResult { + value: T; + hasNext: boolean; + nextLink: string; } function ItemUpdatedParser() { diff --git a/packages/sp/lists/types.ts b/packages/sp/lists/types.ts index b99334e92..17625d6aa 100644 --- a/packages/sp/lists/types.ts +++ b/packages/sp/lists/types.ts @@ -10,11 +10,12 @@ import { ISPCollection, SPCollection, IDeleteableWithETag, + spPost, + spPostMerge, } from "../spqueryable.js"; import { IChangeQuery } from "../types.js"; import { odataUrlFrom } from "../utils/odata-url-from.js"; import { defaultPath } from "../decorators.js"; -import { spPost, spPostMerge } from "../operations.js"; import { IBasePermissions } from "../security/types.js"; import { IFieldInfo } from "../fields/types.js"; import { IFormInfo } from "../forms/types.js"; diff --git a/packages/sp/navigation/types.ts b/packages/sp/navigation/types.ts index 5e519b127..d6355eb5d 100644 --- a/packages/sp/navigation/types.ts +++ b/packages/sp/navigation/types.ts @@ -6,10 +6,11 @@ import { _SPQueryable, IDeleteable, ISPQueryable, + spPost, + spPostMerge, } from "../spqueryable.js"; import { body } from "@pnp/queryable"; import { defaultPath } from "../decorators.js"; -import { spPost, spPostMerge } from "../operations.js"; import { extractWebUrl } from "../index.js"; import { combine } from "@pnp/core"; diff --git a/packages/sp/operations.ts b/packages/sp/operations.ts deleted file mode 100644 index a83491bb8..000000000 --- a/packages/sp/operations.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { op, get, post, patch, del } from "@pnp/queryable"; -import { ISPQueryable } from "./spqueryable.js"; - -export const spGet = (o: ISPQueryable, init?: RequestInit): Promise => { - return op(o, get, init); -}; - -export const spPost = (o: ISPQueryable, init?: RequestInit): Promise => op(o, post, init); - -export const spPostMerge = (o: ISPQueryable, init?: RequestInit): Promise => { - init = init || {}; - init.headers = { ...init.headers, "X-HTTP-Method": "MERGE" }; - - return spPost(o, init); -}; - -export const spPostDelete = (o: ISPQueryable, init?: RequestInit): Promise => { - init = init || {}; - init.headers = { ...init.headers || {}, "X-HTTP-Method": "DELETE" }; - - return spPost(o, init); -}; - -export const spPostDeleteETag = (o: ISPQueryable, init?: RequestInit, eTag = "*"): Promise => { - init = init || {}; - init.headers = { ...init.headers || {}, "IF-Match": eTag }; - - return spPostDelete(o, init); -}; - -export const spDelete = (o: ISPQueryable, init?: RequestInit): Promise => op(o, del, init); - -export const spPatch = (o: ISPQueryable, init?: RequestInit): Promise => op(o, patch, init); diff --git a/packages/sp/profiles/types.ts b/packages/sp/profiles/types.ts index faa0c18b5..4bc5461fb 100644 --- a/packages/sp/profiles/types.ts +++ b/packages/sp/profiles/types.ts @@ -6,11 +6,11 @@ import { ISPInstance, spInvokableFactory, _SPQueryable, + spPost, } from "../spqueryable.js"; import { body } from "@pnp/queryable"; import { PrincipalType, PrincipalSource } from "../types.js"; import { defaultPath } from "../decorators.js"; -import { spPost } from "../operations.js"; import { AssignFrom } from "@pnp/core"; export class _Profiles extends _SPInstance { diff --git a/packages/sp/recycle-bin/types.ts b/packages/sp/recycle-bin/types.ts index 632f0950b..4b0fdb1bf 100644 --- a/packages/sp/recycle-bin/types.ts +++ b/packages/sp/recycle-bin/types.ts @@ -3,9 +3,9 @@ import { spInvokableFactory, SPQueryable, _SPInstance, + spPost, } from "../spqueryable.js"; import { defaultPath } from "../decorators.js"; -import { spPost } from "../operations.js"; /** * Describes a recycle bin item diff --git a/packages/sp/regional-settings/funcs.ts b/packages/sp/regional-settings/funcs.ts index 817a5badb..09878c65f 100644 --- a/packages/sp/regional-settings/funcs.ts +++ b/packages/sp/regional-settings/funcs.ts @@ -1,5 +1,4 @@ -import { _SPQueryable, SPQueryable } from "../spqueryable.js"; -import { spPost } from "../operations.js"; +import { _SPQueryable, SPQueryable, spPost } from "../spqueryable.js"; import { body } from "@pnp/queryable"; export function getValueForUICultureBinder(propName: string): (this: _SPQueryable, cultureName: string) => Promise { diff --git a/packages/sp/regional-settings/types.ts b/packages/sp/regional-settings/types.ts index b753d65c0..eb28e478a 100644 --- a/packages/sp/regional-settings/types.ts +++ b/packages/sp/regional-settings/types.ts @@ -4,9 +4,9 @@ import { SPCollection, spInvokableFactory, _SPCollection, + spPost, } from "../spqueryable.js"; import { defaultPath } from "../decorators.js"; -import { spPost } from "../operations.js"; @defaultPath("regionalsettings") export class _RegionalSettings extends _SPInstance { diff --git a/packages/sp/related-items/types.ts b/packages/sp/related-items/types.ts index 22a6150dd..4fe3e0b72 100644 --- a/packages/sp/related-items/types.ts +++ b/packages/sp/related-items/types.ts @@ -1,7 +1,6 @@ -import { _SPQueryable, ISPQueryable } from "../spqueryable.js"; +import { _SPQueryable, ISPQueryable, spPost } from "../spqueryable.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { defaultPath } from "../decorators.js"; -import { spPost } from "../operations.js"; import { body } from "@pnp/queryable"; @defaultPath("_api/SP.RelatedItemManager") diff --git a/packages/sp/search/query.ts b/packages/sp/search/query.ts index 3519faa82..e1b12c564 100644 --- a/packages/sp/search/query.ts +++ b/packages/sp/search/query.ts @@ -1,8 +1,7 @@ -import { _SPInstance, spInvokableFactory, SPInit } from "../spqueryable.js"; +import { _SPInstance, spInvokableFactory, SPInit, spPost } from "../spqueryable.js"; import { getHashCode, hOP, isArray } from "@pnp/core"; import { body, CacheAlways, CacheKey, invokable } from "@pnp/queryable"; import { ISearchQuery, ISearchResponse, ISearchResult, ISearchBuilder, SearchQueryInit } from "./types.js"; -import { spPost } from "../operations.js"; import { defaultPath } from "../decorators.js"; const funcs = new Map([ diff --git a/packages/sp/security/funcs.ts b/packages/sp/security/funcs.ts index e4c59f546..48b6b9cbd 100644 --- a/packages/sp/security/funcs.ts +++ b/packages/sp/security/funcs.ts @@ -1,6 +1,5 @@ import { SecurableQueryable, IBasePermissions, PermissionKind } from "./types.js"; -import { SPInstance, SPQueryable } from "../spqueryable.js"; -import { spPost } from "../operations.js"; +import { SPInstance, SPQueryable, spPost } from "../spqueryable.js"; /** * Gets the effective permissions for the user supplied diff --git a/packages/sp/security/types.ts b/packages/sp/security/types.ts index b6d35accb..5e084303d 100644 --- a/packages/sp/security/types.ts +++ b/packages/sp/security/types.ts @@ -8,10 +8,11 @@ import { SPCollection, ISPCollection, IDeleteable, + spPost, + spPostMerge, } from "../spqueryable.js"; import { SiteGroups, ISiteGroups } from "../site-groups/types.js"; import { defaultPath } from "../decorators.js"; -import { spPost, spPostMerge } from "../operations.js"; export type SecurableQueryable = _SPInstance & ISecurableMethods; diff --git a/packages/sp/sharing/funcs.ts b/packages/sp/sharing/funcs.ts index c5ee45949..9849c2809 100644 --- a/packages/sp/sharing/funcs.ts +++ b/packages/sp/sharing/funcs.ts @@ -1,6 +1,6 @@ import { body } from "@pnp/queryable"; import { isArray, jsS } from "@pnp/core"; -import { SPCollection, SPInstance } from "../spqueryable.js"; +import { SPCollection, SPInstance, spPost } from "../spqueryable.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { Web } from "../webs/types.js"; import { @@ -18,7 +18,6 @@ import { ISharingEmailData, RoleType, } from "./types.js"; -import { spPost } from "../operations.js"; import { RoleDefinitions } from "../security/types.js"; import { emptyGuid } from "../types.js"; diff --git a/packages/sp/sharing/web.ts b/packages/sp/sharing/web.ts index c7720efd9..9ce75f2a6 100644 --- a/packages/sp/sharing/web.ts +++ b/packages/sp/sharing/web.ts @@ -4,7 +4,7 @@ import { RoleType } from "./types.js"; import { shareObject } from "./funcs.js"; import { combine } from "@pnp/core"; import { body } from "@pnp/queryable"; -import { spPost } from "../operations.js"; +import { spPost } from "../spqueryable.js"; /** * Extend _Web diff --git a/packages/sp/site-designs/types.ts b/packages/sp/site-designs/types.ts index b38a958cd..5b90d120a 100644 --- a/packages/sp/site-designs/types.ts +++ b/packages/sp/site-designs/types.ts @@ -1,10 +1,8 @@ -import { ISPQueryable, _SPQueryable } from "../spqueryable.js"; +import { ISPQueryable, _SPQueryable, spPost } from "../spqueryable.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { headers, body } from "@pnp/queryable"; -import { spPost } from "../operations.js"; import { combine, hOP } from "@pnp/core"; - export class _SiteDesigns extends _SPQueryable { constructor(base: string | ISPQueryable, methodName = "") { diff --git a/packages/sp/site-groups/types.ts b/packages/sp/site-groups/types.ts index ded40e4b2..a3ed9f964 100644 --- a/packages/sp/site-groups/types.ts +++ b/packages/sp/site-groups/types.ts @@ -2,11 +2,12 @@ import { _SPCollection, spInvokableFactory, _SPInstance, + spPost, + spPostMerge, } from "../spqueryable.js"; import { SiteUsers, ISiteUsers } from "../site-users/types.js"; import { body } from "@pnp/queryable"; import { defaultPath } from "../decorators.js"; -import { spPost, spPostMerge } from "../operations.js"; @defaultPath("sitegroups") export class _SiteGroups extends _SPCollection { diff --git a/packages/sp/site-groups/web.ts b/packages/sp/site-groups/web.ts index ac3c950cb..b49d17cba 100644 --- a/packages/sp/site-groups/web.ts +++ b/packages/sp/site-groups/web.ts @@ -1,5 +1,5 @@ import { addProp } from "@pnp/queryable"; -import { spPost } from "../operations.js"; +import { spPost } from "../spqueryable.js"; import { Web, _Web } from "../webs/types.js"; import { ISiteGroups, SiteGroups, ISiteGroup, SiteGroup } from "./types.js"; import "../security/web.js"; diff --git a/packages/sp/site-scripts/types.ts b/packages/sp/site-scripts/types.ts index f2a199390..0cc38aff9 100644 --- a/packages/sp/site-scripts/types.ts +++ b/packages/sp/site-scripts/types.ts @@ -1,6 +1,5 @@ import { body } from "@pnp/queryable"; -import { spPost } from "../operations.js"; -import { ISPQueryable, _SPQueryable } from "../spqueryable.js"; +import { ISPQueryable, _SPQueryable, spPost } from "../spqueryable.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { combine } from "@pnp/core"; import { encodePath } from "../utils/encode-path-str.js"; diff --git a/packages/sp/site-users/types.ts b/packages/sp/site-users/types.ts index 607174e70..a30e3f451 100644 --- a/packages/sp/site-users/types.ts +++ b/packages/sp/site-users/types.ts @@ -4,11 +4,12 @@ import { _SPInstance, IDeleteable, deleteable, + spPost, + spPostMerge, } from "../spqueryable.js"; import { SiteGroups, ISiteGroups } from "../site-groups/types.js"; import { body } from "@pnp/queryable"; import { defaultPath } from "../decorators.js"; -import { spPost, spPostMerge } from "../operations.js"; import { PrincipalType } from "../types.js"; @defaultPath("siteusers") diff --git a/packages/sp/site-users/web.ts b/packages/sp/site-users/web.ts index 5273cfce2..97be709ca 100644 --- a/packages/sp/site-users/web.ts +++ b/packages/sp/site-users/web.ts @@ -2,7 +2,7 @@ import { addProp, body } from "@pnp/queryable"; import { _Web, Web } from "../webs/types.js"; import { ISiteUsers, SiteUsers, ISiteUser, SiteUser, IWebEnsureUserResult } from "./types.js"; import { odataUrlFrom } from "../utils/odata-url-from.js"; -import { spPost } from "../operations.js"; +import { spPost } from "../spqueryable.js"; declare module "../webs/types" { interface _Web { diff --git a/packages/sp/sites/types.ts b/packages/sp/sites/types.ts index fa62e3c3b..a1de6f33f 100644 --- a/packages/sp/sites/types.ts +++ b/packages/sp/sites/types.ts @@ -1,10 +1,9 @@ -import { _SPInstance, spInvokableFactory, SPInit, SPQueryable } from "../spqueryable.js"; +import { _SPInstance, spInvokableFactory, SPInit, SPQueryable, spPatch, spPost } from "../spqueryable.js"; import { defaultPath } from "../decorators.js"; import { Web, IWeb } from "../webs/types.js"; import { combine, hOP, isArray } from "@pnp/core"; import { body, TextParse } from "@pnp/queryable"; import { odataUrlFrom } from "../utils/odata-url-from.js"; -import { spPatch, spPost } from "../operations.js"; import { IChangeQuery } from "../types.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { emptyGuid } from "../types.js"; diff --git a/packages/sp/social/types.ts b/packages/sp/social/types.ts index 2b04e72db..dd1e1501b 100644 --- a/packages/sp/social/types.ts +++ b/packages/sp/social/types.ts @@ -2,11 +2,11 @@ import { _SPInstance, ISPQueryable, SPInit, + spPost, } from "../spqueryable.js"; import { defaultPath } from "../decorators.js"; import { hOP } from "@pnp/core"; import { body } from "@pnp/queryable"; -import { spPost } from "../operations.js"; @defaultPath("_api/social.following") export class _Social extends _SPInstance implements ISocial { diff --git a/packages/sp/spqueryable.ts b/packages/sp/spqueryable.ts index e246c3d35..775e2db6b 100644 --- a/packages/sp/spqueryable.ts +++ b/packages/sp/spqueryable.ts @@ -1,6 +1,5 @@ import { combine, isUrlAbsolute, isArray, objectDefinedNotNull, stringIsNullOrEmpty } from "@pnp/core"; -import { IInvokable, Queryable, queryableFactory } from "@pnp/queryable"; -import { spPostDelete, spPostDeleteETag } from "./operations.js"; +import { IInvokable, Queryable, queryableFactory, op, get, post, patch, del } from "@pnp/queryable"; export type SPInit = string | ISPQueryable | [ISPQueryable, string]; @@ -242,3 +241,34 @@ export interface IDeleteableWithETag { */ delete(eTag?: string): Promise; } + +export const spGet = (o: ISPQueryable, init?: RequestInit): Promise => { + return op(o, get, init); +}; + +export const spPost = (o: ISPQueryable, init?: RequestInit): Promise => op(o, post, init); + +export const spPostMerge = (o: ISPQueryable, init?: RequestInit): Promise => { + init = init || {}; + init.headers = { ...init.headers, "X-HTTP-Method": "MERGE" }; + + return spPost(o, init); +}; + +export const spPostDelete = (o: ISPQueryable, init?: RequestInit): Promise => { + init = init || {}; + init.headers = { ...init.headers || {}, "X-HTTP-Method": "DELETE" }; + + return spPost(o, init); +}; + +export const spPostDeleteETag = (o: ISPQueryable, init?: RequestInit, eTag = "*"): Promise => { + init = init || {}; + init.headers = { ...init.headers || {}, "IF-Match": eTag }; + + return spPostDelete(o, init); +}; + +export const spDelete = (o: ISPQueryable, init?: RequestInit): Promise => op(o, del, init); + +export const spPatch = (o: ISPQueryable, init?: RequestInit): Promise => op(o, patch, init); diff --git a/packages/sp/sputilities/types.ts b/packages/sp/sputilities/types.ts index a524d75da..ce49ca528 100644 --- a/packages/sp/sputilities/types.ts +++ b/packages/sp/sputilities/types.ts @@ -1,8 +1,7 @@ import { body } from "@pnp/queryable"; -import { _SPQueryable, spInvokableFactory, ISPQueryable, SPInit } from "../spqueryable.js"; +import { _SPQueryable, spInvokableFactory, ISPQueryable, SPInit, spPost } from "../spqueryable.js"; import { IPrincipalInfo, PrincipalType, PrincipalSource } from "../types.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; -import { spPost } from "../operations.js"; import { combine } from "@pnp/core"; export class _Utilities extends _SPQueryable implements IUtilities { diff --git a/packages/sp/subscriptions/types.ts b/packages/sp/subscriptions/types.ts index 9f2c121c7..066265368 100644 --- a/packages/sp/subscriptions/types.ts +++ b/packages/sp/subscriptions/types.ts @@ -2,10 +2,12 @@ import { _SPCollection, spInvokableFactory, _SPInstance, + spPost, + spPatch, + spDelete, } from "../spqueryable.js"; import { body } from "@pnp/queryable"; import { defaultPath } from "../decorators.js"; -import { spPost, spPatch, spDelete } from "../operations.js"; @defaultPath("subscriptions") export class _Subscriptions extends _SPCollection { diff --git a/packages/sp/taxonomy/types.ts b/packages/sp/taxonomy/types.ts index 36b7a3975..5f3957d02 100644 --- a/packages/sp/taxonomy/types.ts +++ b/packages/sp/taxonomy/types.ts @@ -1,8 +1,7 @@ import { isArray } from "@pnp/core"; import { body } from "@pnp/queryable"; import { defaultPath } from "../decorators.js"; -import { spDelete, spPatch, spPost } from "../operations.js"; -import { _SPInstance, spInvokableFactory, _SPCollection } from "../spqueryable.js"; +import { _SPInstance, spInvokableFactory, _SPCollection, spDelete, spPatch, spPost } from "../spqueryable.js"; import { encodePath } from "../utils/encode-path-str.js"; /** diff --git a/packages/sp/user-custom-actions/types.ts b/packages/sp/user-custom-actions/types.ts index e39db3d58..d3d98136d 100644 --- a/packages/sp/user-custom-actions/types.ts +++ b/packages/sp/user-custom-actions/types.ts @@ -4,10 +4,11 @@ import { deleteable, _SPInstance, IDeleteable, + spPost, + spPostMerge, } from "../spqueryable.js"; import { body } from "@pnp/queryable"; import { defaultPath } from "../decorators.js"; -import { spPost, spPostMerge } from "../operations.js"; import { IBasePermissions } from "../security/index.js"; @defaultPath("usercustomactions") diff --git a/packages/sp/views/types.ts b/packages/sp/views/types.ts index f80665a9f..e240cdfbd 100644 --- a/packages/sp/views/types.ts +++ b/packages/sp/views/types.ts @@ -5,9 +5,10 @@ import { _SPInstance, deleteable, IDeleteable, + spPost, + spPostMerge, } from "../spqueryable.js"; import { defaultPath } from "../decorators.js"; -import { spPost, spPostMerge } from "../operations.js"; import { encodePath } from "../utils/encode-path-str.js"; @defaultPath("views") diff --git a/packages/sp/webparts/types.ts b/packages/sp/webparts/types.ts index 7c2c54ce7..87edec000 100644 --- a/packages/sp/webparts/types.ts +++ b/packages/sp/webparts/types.ts @@ -7,9 +7,9 @@ import { spInvokableFactory, SPInstance, ISPInstance, + spPost, } from "../spqueryable.js"; import { body } from "@pnp/queryable"; -import { spPost } from "../operations.js"; export class _LimitedWebPartManager extends _SPQueryable implements ILimitedWebPartManager { diff --git a/packages/sp/webs/types.ts b/packages/sp/webs/types.ts index 3767b35f1..afce2af61 100644 --- a/packages/sp/webs/types.ts +++ b/packages/sp/webs/types.ts @@ -11,11 +11,12 @@ import { deleteable, SPInit, ISPQueryable, + spPost, + spPostMerge, } from "../spqueryable.js"; import { defaultPath } from "../decorators.js"; import { IChangeQuery } from "../types.js"; import { odataUrlFrom } from "../utils/odata-url-from.js"; -import { spPost, spPostMerge } from "../operations.js"; import { extractWebUrl } from "../utils/extract-web-url.js"; import { combine, isArray } from "@pnp/core"; import { encodePath } from "../utils/encode-path-str.js"; diff --git a/test/core/assumptions.ts b/test/core/assumptions.ts index 780047807..38e17eafe 100644 --- a/test/core/assumptions.ts +++ b/test/core/assumptions.ts @@ -3,10 +3,11 @@ // our assumptions remain correct import { expect } from "chai"; +import { pnpTest } from "../pnp-test.js"; describe("Assumptions", function () { - it("JS should merge objects how we expect", function () { + it("JS should merge objects how we expect", pnpTest("3576d9bf-aa31-4b3f-8400-104513956328", function () { const o = {}; @@ -58,9 +59,9 @@ describe("Assumptions", function () { expect(test5, "test 5").to.eql({}); - }); + })); - it("should destructure how we assume", function () { + it("should destructure how we assume", pnpTest("67a889c9-a45a-4978-a181-91d5d096edeb", function () { const props = { yes: false, @@ -95,5 +96,5 @@ describe("Assumptions", function () { expect(title).to.eq("hello"); expect(another).to.eq("something"); - }); + })); }); diff --git a/test/core/storage.ts b/test/core/storage.ts index 81953379e..e0017430f 100644 --- a/test/core/storage.ts +++ b/test/core/storage.ts @@ -1,5 +1,6 @@ import { expect } from "chai"; import { PnPClientStorage } from "@pnp/core"; +import { pnpTest } from "../pnp-test.js"; describe("Storage", function () { @@ -7,54 +8,54 @@ describe("Storage", function () { let storage: PnPClientStorage; - beforeEach(function () { + beforeEach(pnpTest("71bacb4d-2a28-4da3-a09b-7b8625345586", function () { storage = new PnPClientStorage(); - }); + })); - it("Add and Get a value (local)", function () { + it("Add and Get a value (local)", pnpTest("4986f3f6-3b31-4ac5-9746-62384a108ae1", function () { storage.local.put("test", "value"); const ret = storage.local.get("test"); expect(ret).to.eq("value"); - }); + })); - it("Add two values, remove one and still return the other (local)", function () { + it("Add two values, remove one and still return the other (local)", pnpTest("b370742a-0eb9-40f5-bb75-43b667f51181", function () { storage.local.put("test1", "value1"); storage.local.put("test2", "value2"); storage.local.delete("test1"); const ret = storage.local.get("test2"); expect(ret).to.eq("value2"); - }); + })); - it("Use getOrPut to add a value using a getter function and return it (local)", function () { + it("Use getOrPut to add a value using a getter function and return it (local)", pnpTest("6f8a3a57-6e1e-4e26-9c86-2bfb05085c5e", function () { storage.local.getOrPut("test", function () { return new Promise(() => "value"); }).then(function () { const ret = storage.local.get("test"); expect(ret).to.eq("value"); }); - }); + })); - it("Add and Get a value (session)", function () { + it("Add and Get a value (session)", pnpTest("71cc7886-18d7-4362-b232-07afd7d6b750", function () { storage.session.put("test", "value"); const ret = storage.session.get("test"); expect(ret).to.eq("value"); - }); + })); - it("Add two values, remove one and still return the other (session)", function () { + it("Add two values, remove one and still return the other (session)", pnpTest("8c570f93-d6aa-49f3-a740-d884f1832b59", function () { storage.session.put("test1", "value1"); storage.session.put("test2", "value2"); storage.session.delete("test1"); const ret = storage.session.get("test2"); expect(ret).to.eq("value2"); - }); + })); - it("Use getOrPut to add a value using a getter function and return it (session)", function () { + it("Use getOrPut to add a value using a getter function and return it (session)", pnpTest("0c25edf5-120e-48d3-b6cd-e2da49391d21", function () { storage.session.getOrPut("test", function () { return new Promise(() => "value"); }).then(function () { const ret = storage.session.get("test"); expect(ret).to.eq("value"); }); - }); + })); }); }); diff --git a/test/core/timeline.ts b/test/core/timeline.ts index a3ab8543e..3d509f362 100644 --- a/test/core/timeline.ts +++ b/test/core/timeline.ts @@ -1,5 +1,6 @@ import { Timeline, asyncReduce } from "@pnp/core"; import { expect } from "chai"; +import { pnpTest } from "../pnp-test.js"; const TestingMoments = { first: asyncReduce<(a: number) => Promise<[number]>>(), @@ -62,7 +63,7 @@ describe("Timeline", function () { return expect(h).to.eq(2); }); - it("Should process moments 2", async function () { + it("Should process moments 2", pnpTest("8267d3af-554d-44d8-8b00-e33ce7d93f1d", async function () { const tl = new TestTimeline(); @@ -78,9 +79,9 @@ describe("Timeline", function () { const h = await tl.go(0); return expect(h).to.eq(7); - }); + })); - it("Prepend works as expected", function () { + it("Prepend works as expected", pnpTest("890664f0-0e7f-4aa5-bc73-55fa4b05b27b", function () { const tl = new TestTimeline(); @@ -97,9 +98,9 @@ describe("Timeline", function () { expect(observers[0]).to.eq(f3); expect(observers[1]).to.eq(f1); expect(observers[2]).to.eq(f2); - }); + })); - it("Clear works as expected", function () { + it("Clear works as expected", pnpTest("66b43d34-7e34-4506-abc9-4d12b8286937", function () { const tl = new TestTimeline(); @@ -120,9 +121,9 @@ describe("Timeline", function () { const observers2 = tl.on.first.toArray(); expect(observers2).length(0); - }); + })); - it("Replace works as expected", function () { + it("Replace works as expected", pnpTest("b162d48e-2ddd-4b36-8fee-fc3c9ef18838", function () { const tl = new TestTimeline(); @@ -144,9 +145,9 @@ describe("Timeline", function () { expect(observers2).length(1); expect(observers2[0]).to.eq(f1); - }); + })); - it("Logging works as expected", function () { + it("Logging works as expected", pnpTest("0506ad5a-7d00-4f0e-b436-46c90faadd9d", function () { const tl = new TestTimeline(); @@ -161,9 +162,9 @@ describe("Timeline", function () { tl.log("Test 2", 0); expect(messages.length).to.eq(2); - }); + })); - it("Lifecycle works as expected", async function () { + it("Lifecycle works as expected", pnpTest("a7dda9ad-cb00-4ad8-b717-4de294e02ad2", async function () { const tl = new TestTimeline(); @@ -201,5 +202,5 @@ describe("Timeline", function () { expect(tracker[1]).to.eq(2); expect(tracker[2]).to.eq(3); expect(tracker[3]).to.eq(4); - }); + })); }); diff --git a/test/core/util.ts b/test/core/util.ts index 8c953374e..33485f83f 100644 --- a/test/core/util.ts +++ b/test/core/util.ts @@ -13,111 +13,122 @@ import { hOP, getHashCode, } from "@pnp/core"; +import { pnpTest } from "../pnp-test.js"; // tslint:disable:no-unused-expression describe("dateAdd", function () { - it("Add 5 Minutes", function () { + + it("Add 5 Minutes", pnpTest("e5eeda9b-2378-430c-a9d9-ac952c0b4f8e", function () { const testDate = new Date(); const checkDate = new Date(testDate.toLocaleString()); checkDate.setMinutes(testDate.getMinutes() + 5); expect(dateAdd(testDate, "minute", 5).getMinutes()).to.eq(checkDate.getMinutes()); - }); + })); - it("Add 2 Years", function () { + it("Add 2 Years", pnpTest("2a25ffc5-4f96-4f59-9a57-26ea74d1a3b5", function () { const testDate = new Date(); const checkDate = new Date(testDate.toLocaleString()); checkDate.setFullYear(testDate.getFullYear() + 2); expect(dateAdd(testDate, "year", 2).getFullYear()).to.eq(checkDate.getFullYear()); - }); + })); + }); describe("combine", function () { - it("Path (1)", function () { + + it("Path (1)", pnpTest("e8cedd77-c58d-4277-9465-6afa2e73adae", function () { expect(combine("/path/", "path2", "path3", "/path4")).to.eq("path/path2/path3/path4"); - }); + })); - it("Path (2)", function () { + it("Path (2)", pnpTest("1b9f2dc6-5b17-4573-8a65-2ef651b8972c", function () { expect(combine("http://site/path/", "/path4/page.aspx")).to.eq("http://site/path/path4/page.aspx"); - }); + })); - it("Path (3)", function () { + it("Path (3)", pnpTest("df90d9c6-c841-42f4-88d0-fb4d1a0451a5", function () { expect(combine(null, "path2", undefined, null, "/path4")).to.eq("path2/path4"); - }); + })); - it("Path (4)", function () { + it("Path (4)", pnpTest("b8564799-f0cb-4183-81a9-564e1480eba4", function () { expect(combine(null, "path2", undefined, "", null, "/path4")).to.eq("path2/path4"); - }); + })); - it("No Path", function () { + it("No Path", pnpTest("502a081f-144e-45c8-8115-c1ad4bc75d72", function () { expect(combine()).to.eq(""); - }); + })); + }); describe("getRandomString", function () { - it("Length 5", function () { + + it("Length 5", pnpTest("6c726b85-720a-4793-b5f6-2d302d16eb5b", function () { const j = getRandomString(5); expect(j).to.be.a("string"); expect(j).to.have.length(5); - }); + })); - it("Length 28", function () { + it("Length 28", pnpTest("26afbb93-8d8d-4f2a-a1c0-b3a0fb78c6bb", function () { const j = getRandomString(28); expect(j).to.be.a("string"); expect(j).to.have.length(28); - }); + })); + }); describe("getGUID", function () { - it("Test Pattern", function () { + + it("Test Pattern", pnpTest("78cd5f6d-d30a-4c0c-b44f-f55e34e39b06", function () { expect(getGUID()).to.match(/[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}/i); - }); + })); + }); describe("isFunc", function () { - it("True", function () { + + it("True", pnpTest("ff0020e6-0e1b-4b12-a4a1-8a4b2fc8fcdb", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isFunc(function () { return; })).to.be.true; - }); + })); - it("False", function () { + it("False", pnpTest("2a147d36-64ad-4888-a425-e4d18ead4448", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isFunc({ val: 0 })).to.be.false; // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isFunc(null)).to.be.false; // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isFunc(undefined)).to.be.false; - }); + })); }); describe("objectDefinedNotNull", function () { - it("defined", function () { + it("defined", pnpTest("71a58271-6205-4a7b-b651-9322a36398cc", function () { return expect(objectDefinedNotNull({})).to.be.true; - }); + })); - it("null", function () { + it("null", pnpTest("56af5be3-06e1-41b9-8183-2a9d7654052b", function () { return expect(objectDefinedNotNull(null)).to.be.false; - }); + })); - it("undefined", function () { + it("undefined", pnpTest("65dcfc1f-1c3b-488d-9bc5-3a5dd36e06a3", function () { return expect(objectDefinedNotNull(undefined)).to.be.false; - }); + })); }); describe("isArray", function () { - it("True", function () { + + it("True", pnpTest("3ad9a949-f147-47a7-868c-e1ae0fc9d65e", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isArray([1, 2, 3, 4])).to.be.true; - }); + })); - it("False", function () { + it("False", pnpTest("d2bb66ab-b7ed-4e3d-828a-2044d4a4ffed", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isArray(null)).to.be.false; // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -128,78 +139,89 @@ describe("isArray", function () { expect(isArray({})).to.be.false; // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isArray(undefined)).to.be.false; - }); + })); + }); describe("isUrlAbsolute", function () { - it("Yes (1)", function () { + + it("Yes (1)", pnpTest("edc77eae-ddd3-427c-aae8-863e79583c05", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isUrlAbsolute("https://something.com")).to.be.true; - }); + })); - it("Yes (2)", function () { + it("Yes (2)", pnpTest("25999d21-cc28-4582-bdb5-31fa59af1191", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isUrlAbsolute("//something.com")).to.be.true; - }); + })); - it("Yes (3)", function () { + it("Yes (3)", pnpTest("32547e58-299a-4979-a875-6d2dfdf324cc", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isUrlAbsolute("http://something.com")).to.be.true; - }); + })); - it("No (1)", function () { + it("No (1)", pnpTest("2ee70c05-0f90-47ce-a6cf-801bf459cfca", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isUrlAbsolute("/sites/dev")).to.be.false; - }); + })); - it("No (2)", function () { + it("No (2)", pnpTest("7b6b7504-fd43-4c4d-ad65-e944a11148e9", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isUrlAbsolute("sites/dev")).to.be.false; - }); + })); - it("Empty", function () { + it("Empty", pnpTest("38c0cfa1-e518-47e9-a09a-7e941516dfb0", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(isUrlAbsolute("")).to.be.false; - }); + })); + }); describe("stringIsNullOrEmpty", function () { - it("Yes (1)", function () { + + it("Yes (1)", pnpTest("2c88a924-49d4-4468-b4ed-47dc59341499", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(stringIsNullOrEmpty(null)).to.be.true; - }); + })); - it("Yes (2)", function () { + it("Yes (2)", pnpTest("146cfe8e-3e74-420b-bde7-feec421fb3a8", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(stringIsNullOrEmpty("")).to.be.true; - }); + })); - it("No", function () { + it("No", pnpTest("e843faac-0423-44ee-8206-00468296ea61", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(stringIsNullOrEmpty("not empty")).to.be.false; - }); + })); + }); describe("jsS", function () { + it("Sucess", function () { expect(jsS({ test: true })).to.eq("{\"test\":true}"); }); + }); describe("hOP", function () { - it("Success", function () { + + it("Success", pnpTest("f1d3a279-c51e-4c1b-a3d3-3d8ef3c747f6", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(hOP({ test: true }, "test")).to.be.true; - }); - it("Fail", function () { + })); + + it("Fail", pnpTest("d65fb0d9-be6e-4a3d-9ba9-44e85e8d6288", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(hOP({ test: true }, "nope")).to.be.false; - }); + })); }); describe("getHashCode", function () { - it("Success", function () { + + it("Success", pnpTest("dcd0ccfc-b4ff-4d9f-bd37-8a1b14d2baea", function () { expect(getHashCode("test string value")).to.be.a("number"); expect(getHashCode("test string value !@#$%^&*()_+{}<>,.?/'\"")).to.be.a("number"); - }); + })); + }); diff --git a/test/graph/batch.ts b/test/graph/batch.ts index ab6602144..69016324e 100644 --- a/test/graph/batch.ts +++ b/test/graph/batch.ts @@ -3,6 +3,7 @@ import "@pnp/graph/groups"; import "@pnp/graph/sites"; import { createBatch } from "@pnp/graph/batching"; import { expect } from "chai"; +import { pnpTest } from "../pnp-test.js"; describe("Batching", function () { @@ -13,7 +14,7 @@ describe("Batching", function () { } }); - it("Single Request", async function () { + it("Single Request", pnpTest("104a9d10-ef6f-485f-961e-45014147f52a", async function () { const order: number[] = []; const expected: number[] = [1, 2]; @@ -27,9 +28,9 @@ describe("Batching", function () { order.push(2); return expect(order.toString()).to.eql(expected.toString()); - }); + })); - it("Even # Requests", async function () { + it("Even # Requests", pnpTest("52bb031b-2a18-46e7-bb1b-8c0085812e0d", async function () { const order: number[] = []; const expected: number[] = [1, 2, 3]; @@ -48,9 +49,9 @@ describe("Batching", function () { order.push(3); return expect(order.toString()).to.eql(expected.toString()); - }); + })); - it("Odd # Requests", async function () { + it("Odd # Requests", pnpTest("0f5f9c29-7da8-483b-8c7d-4a6a9656bb92", async function () { const order: number[] = []; const expected: number[] = [1, 2, 3, 4]; @@ -72,9 +73,9 @@ describe("Batching", function () { order.push(4); return expect(order.toString()).to.eql(expected.toString()); - }); + })); - it("Should work with the same Queryable when properly cloned (Advanced)", async function () { + it("Should work with the same Queryable when properly cloned (Advanced)", pnpTest("76fbb5bf-dfc5-4230-a9df-ef1ecc2ee7a4", async function () { const users = this.pnp.graph.users; @@ -87,9 +88,9 @@ describe("Batching", function () { this.pnp.graph.users.using(batchedBehavior)(); return expect(execute()).to.eventually.be.fulfilled; - }); + })); - it("Should work with the same Queryable when properly cloned by factory (Advanced)", async function () { + it("Should work with the same Queryable when properly cloned by factory (Advanced)", pnpTest("d0ba8747-a776-4f4e-be09-6a6126dc1e06", async function () { const users = this.pnp.graph.users; @@ -101,9 +102,9 @@ describe("Batching", function () { Users(users).using(batchedBehavior)(); return expect(execute()).to.eventually.be.fulfilled; - }); + })); - it("Should fail with the same Queryable (Advanced)", async function () { + it("Should fail with the same Queryable (Advanced)", pnpTest("ca3ae3bb-1729-47d9-abea-e531cd7817dc", async function () { const users = this.pnp.graph.users; @@ -121,5 +122,6 @@ describe("Batching", function () { // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(p2).to.eventually.be.fulfilled; - }); + })); + }); diff --git a/test/graph/calendars.ts b/test/graph/calendars.ts index 68251730b..69bd1f0bc 100644 --- a/test/graph/calendars.ts +++ b/test/graph/calendars.ts @@ -5,6 +5,8 @@ import { HttpRequestError } from "@pnp/queryable"; import { stringIsNullOrEmpty } from "@pnp/core"; import getValidUser from "./utilities/getValidUser.js"; +// TODO:: test recording setup + describe("Calendar", function () { let testUserName = ""; diff --git a/test/graph/columns.ts b/test/graph/columns.ts index 161a9ab52..eaff39179 100644 --- a/test/graph/columns.ts +++ b/test/graph/columns.ts @@ -9,6 +9,7 @@ import { ISite } from "@pnp/graph/sites"; import { IContentType } from "@pnp/graph/content-types"; import { getRandomString } from "@pnp/core"; import getTestingGraphSPSite from "./utilities/getTestingGraphSPSite.js"; +import { pnpTest } from "../pnp-test.js"; describe("Columns", function () { @@ -31,12 +32,16 @@ describe("Columns", function () { }, }; - before(async function () { + before(pnpTest("7fa03413-981c-4d51-be83-8b1b9155985a", async function () { if (!this.pnp.settings.enableWebTests) { this.skip(); } + const props = await this.props({ + templateName: getRandomString(5) + "Columns", + }); + site = await getTestingGraphSPSite(this); const ctTemplate = JSON.parse(JSON.stringify({ @@ -50,7 +55,7 @@ describe("Columns", function () { id: "0x0100CDB27E23CEF44850904C80BD666FA645", })); - ctTemplate.name += getRandomString(5) + "Columns"; + ctTemplate.name += props.templateName; const addCT = await site.contentTypes.add(ctTemplate); contentType = addCT.contentType; @@ -61,7 +66,7 @@ describe("Columns", function () { }); list = addList.list; - }); + })); after(async function () { if (list != null) { @@ -73,15 +78,16 @@ describe("Columns", function () { }); describe("Site", function () { - it("columns", async function () { + + it("columns", pnpTest("052a70b6-953b-4267-800d-900b0bf1539d", async function () { const columns = await site.columns(); expect(columns).to.be.an("array"); if (columns.length > 0) { expect(columns[0]).to.haveOwnProperty("id"); } - }); + })); - it("getById()", async function () { + it("getById()", pnpTest("e2ebde42-c5a9-4301-9fdc-92dd711d5414", async function () { let passed = true; const columns = await site.columns(); if (columns.length > 0) { @@ -89,33 +95,50 @@ describe("Columns", function () { passed = (column.id === columns[0].id); } return expect(passed).is.true; - }); + })); + + it("add", pnpTest("7880c343-29a8-4c44-9fb3-4b39f4309c36", async function () { + + const props = await this.props({ + displayName: getRandomString(5) + "Add", + }); - it("add", async function () { const columnTemplate = JSON.parse(JSON.stringify(sampleColumn)); columnTemplate.name += "Add"; - columnTemplate.displayName += getRandomString(5) + "Add"; + columnTemplate.displayName += props.displayName; const c = await site.columns.add(columnTemplate); await site.columns.getById(c.data.id).delete(); return expect((c.data.name === columnTemplate.name)).to.be.true; - }); + })); + + it("update", pnpTest("8ce610b0-3139-4e2b-9d90-47ad43247250", async function () { + + const props = await this.props({ + name: getRandomString(5) + "Update", + displayName: getRandomString(5) + "Update", + }); - it("update", async function () { const columnTemplate = JSON.parse(JSON.stringify(sampleColumn)); - columnTemplate.name += getRandomString(5) + "Update"; - columnTemplate.displayName += getRandomString(5) + "Update"; + columnTemplate.name += props.name; + columnTemplate.displayName += props.displayName; const newColumnName = `${columnTemplate.displayName}-CHANGED`; const c = await site.columns.add(columnTemplate); await site.columns.getById(c.data.id).update({ displayName: newColumnName }); const updateColumn = await site.columns.getById(c.data.id)(); await site.columns.getById(c.data.id).delete(); return expect((updateColumn.displayName === newColumnName)).to.be.true; - }); + })); + + it("delete", pnpTest("bcb9bafc-4d9c-40d3-a335-b6ff9650e25c", async function () { + + const props = await this.props({ + name: getRandomString(5) + "Update", + displayName: getRandomString(5) + "Update", + }); - it("delete", async function () { const columnTemplate = JSON.parse(JSON.stringify(sampleColumn)); - columnTemplate.name += getRandomString(5) + "Delete"; - columnTemplate.displayName += getRandomString(5) + "Delete"; + columnTemplate.name += props.name; + columnTemplate.displayName += props.displayName; const c = await site.columns.add(columnTemplate); await site.columns.getById(c.data.id).delete(); let deletedColumn: ColumnDefinition = null; @@ -125,24 +148,30 @@ describe("Columns", function () { // do nothing } return expect(deletedColumn).to.be.null; - }); + })); }); describe("Content-Type", function () { let siteColumn; - const columnTemplateName = sampleColumn.name + getRandomString(5) + "SiteColumn"; + let columnTemplateName; - before(async function () { + before(pnpTest("7b7c0559-06c7-4c7d-881e-bfc33d47c31a", async function () { if (!this.pnp.settings.enableWebTests) { this.skip(); } + const props = await this.props({ + columnTemplateName: sampleColumn.name + getRandomString(5) + "SiteColumn", + }); + + columnTemplateName = props.columnTemplateName; + const columnTemplate = JSON.parse(JSON.stringify(sampleColumn)); columnTemplate.name = columnTemplateName; columnTemplate.displayName = columnTemplateName; const addSiteCT = await site.columns.add(columnTemplate); siteColumn = addSiteCT.column; - }); + })); after(async function () { if (siteColumn != null) { @@ -150,12 +179,12 @@ describe("Columns", function () { } }); - it("columns", async function () { + it("columns", pnpTest("0312da75-4067-4d63-bb2c-e5f0d35f4b53", async function () { const columns = await contentType.columns(); return expect(columns).to.be.an("array") && expect(columns[0]).to.haveOwnProperty("id"); - }); + })); - it("getById()", async function () { + it("getById()", pnpTest("d518e3f7-566d-4404-8e97-6cea48d5b1d1", async function () { let passed = true; const columns = await contentType.columns(); if (columns.length > 0) { @@ -163,23 +192,23 @@ describe("Columns", function () { passed = (column.id === columns[0].id); } return expect(passed).is.true; - }); + })); - it("addRef", async function () { + it("addRef", pnpTest("9dd8c09e-9e07-42e2-ac2d-5685966d2aa0", async function () { const c = await contentType.columns.addRef(siteColumn); await contentType.columns.getById(c.data.id).delete(); return expect((c.data.name === columnTemplateName)).to.be.true; - }); + })); // Site column properties cannot be updated in content type. - it.skip("update", async function () { + it.skip("update", pnpTest("c3afb14e-3f42-48e8-9ea6-43be8d231762", async function () { const c = await contentType.columns.addRef(siteColumn); const updateColumnResults = await contentType.columns.getById(c.data.id).update({ propagateChanges: true }); await contentType.columns.getById(c.data.id).delete(); return expect((updateColumnResults.propagateChanges)).to.be.true; - }); + })); - it("delete", async function () { + it("delete", pnpTest("4d6e18c1-abe7-4cd4-a90e-1c1715d5e1ce", async function () { const c = await contentType.columns.addRef(siteColumn); await contentType.columns.getById(c.data.id).delete(); let deletedColumn: ColumnDefinition = null; @@ -189,16 +218,16 @@ describe("Columns", function () { // do nothing } return expect(deletedColumn).to.be.null; - }); + })); }); describe("List", function () { - it("columns", async function () { + it("columns", pnpTest("2b7ff4ba-7b59-49ad-9d98-cda8bec9a012", async function () { const columns = await list.columns(); return expect(columns).to.be.an("array") && expect(columns[0]).to.haveOwnProperty("id"); - }); + })); - it("getById()", async function () { + it("getById()", pnpTest("1560f120-d7da-491a-b27b-48c7b7d124ca", async function () { let passed = true; const columns = await list.columns(); if (columns.length > 0) { @@ -206,33 +235,50 @@ describe("Columns", function () { passed = (column.id === columns[0].id); } return expect(passed).is.true; - }); + })); + + it("add", pnpTest("387b5fb8-14b7-4c9a-8719-f62bc2289780", async function () { + + const props = await this.props({ + displayName: getRandomString(5) + "Add", + }); - it("add", async function () { const columnTemplate = JSON.parse(JSON.stringify(sampleColumn)); columnTemplate.name += "Add"; - columnTemplate.displayName += getRandomString(5) + "Add"; + columnTemplate.displayName += props.displayName; const c = await list.columns.add(columnTemplate); await list.columns.getById(c.data.id).delete(); return expect((c.data.name === columnTemplate.name)).to.be.true; - }); + })); + + it("update", pnpTest("3827a66a-2f8b-4cd7-addb-b49eac258f45", async function () { + + const props = await this.props({ + name: getRandomString(5) + "Update", + displayName: getRandomString(5) + "Update", + }); - it("update", async function () { const columnTemplate = JSON.parse(JSON.stringify(sampleColumn)); - columnTemplate.name += getRandomString(5) + "Update"; - columnTemplate.displayName += getRandomString(5) + "Update"; + columnTemplate.name += props.name; + columnTemplate.displayName += props.displayName; const newColumnName = `${columnTemplate.displayName}-CHANGED`; const c = await list.columns.add(columnTemplate); await list.columns.getById(c.data.id).update({ displayName: newColumnName }); const updateColumn = await list.columns.getById(c.data.id)(); await list.columns.getById(c.data.id).delete(); return expect((updateColumn.displayName === newColumnName)).to.be.true; - }); + })); + + it("delete", pnpTest("16650b92-045a-4bfe-8f37-a8a8856385f2", async function () { + + const props = await this.props({ + name: getRandomString(5) + "Delete", + displayName: getRandomString(5) + "Delete", + }); - it("delete", async function () { const columnTemplate = JSON.parse(JSON.stringify(sampleColumn)); - columnTemplate.name += getRandomString(5) + "Delete"; - columnTemplate.displayName += getRandomString(5) + "Delete"; + columnTemplate.name += props.name; + columnTemplate.displayName += props.displayName; const c = await list.columns.add(columnTemplate); await list.columns.getById(c.data.id).delete(); let deletedColumn: ColumnDefinition = null; @@ -242,6 +288,6 @@ describe("Columns", function () { // do nothing } return expect(deletedColumn).to.be.null; - }); + })); }); }); diff --git a/test/graph/contacts.ts b/test/graph/contacts.ts index 43ccd17c4..817f41f9e 100644 --- a/test/graph/contacts.ts +++ b/test/graph/contacts.ts @@ -4,6 +4,8 @@ import "@pnp/graph/contacts"; import { HttpRequestError } from "@pnp/queryable"; import { getRandomString, stringIsNullOrEmpty } from "@pnp/core"; +// TODO:: make work with test recording + describe("Contacts", function () { let testUserName = ""; diff --git a/test/graph/content-types.ts b/test/graph/content-types.ts index 8e3cf65d4..0f04a3803 100644 --- a/test/graph/content-types.ts +++ b/test/graph/content-types.ts @@ -7,6 +7,7 @@ import { IList } from "@pnp/graph/lists"; import { ISite } from "@pnp/graph/sites"; import { getRandomString } from "@pnp/core"; import getTestingGraphSPSite from "./utilities/getTestingGraphSPSite.js"; +import { pnpTest } from "../pnp-test.js"; describe("ContentTypes", function () { let site: ISite; @@ -23,21 +24,25 @@ describe("ContentTypes", function () { id: "0x0100CDB27E23CEF44850904C80BD666FA645", }; - before(async function () { + before(pnpTest("558cdcaf-dfe4-47e1-a310-7b1c4c9e5d1d", async function () { if (!this.pnp.settings.enableWebTests) { this.skip(); } + const props = await this.props({ + displayName: `PnPGraphTestContentTypes_${getRandomString(8)}`, + }); + site = await getTestingGraphSPSite(this); const listTmp = await site.lists.add({ - displayName: `PnPGraphTestContentTypes_${getRandomString(8)}`, + displayName: props.displayName, list: { "template": "genericList" }, }); list = site.lists.getById(listTmp.data.id); - }); + })); after(async function () { if (list != null) { @@ -47,12 +52,12 @@ describe("ContentTypes", function () { describe("Site", function () { - it("content types", async function () { + it("content types", pnpTest("adc47d1e-6b59-4287-a7f6-1fa42a0862e2", async function () { const ct = await site.contentTypes(); return expect(ct).to.be.an("array") && expect(ct[0]).to.haveOwnProperty("id"); - }); + })); - it("getById", async function () { + it("getById", pnpTest("ab0e1dc6-6387-404f-8acc-b8025d5aa049", async function () { let passed = true; const cts = await site.contentTypes(); if (cts.length > 0) { @@ -60,20 +65,25 @@ describe("ContentTypes", function () { passed = (ct.id === cts[0].id); } return expect(passed).is.true; - }); + })); - it("getCompatibleFromHub", async function () { + it("getCompatibleFromHub", pnpTest("42b30d81-10bf-490e-aaee-e8a2c67c8006", async function () { const cts = await site.contentTypes.getCompatibleHubContentTypes(); return expect(cts).to.be.an("array"); - }); + })); + + it("add", pnpTest("3e939430-6d79-45e9-92cf-1a296a2e0911", async function () { + + const props = await this.props({ + name: getRandomString(5) + "Add", + }); - it("add", async function () { const ctTemplate = JSON.parse(JSON.stringify(sampleContentType)); - ctTemplate.name += getRandomString(5) + "Add"; + ctTemplate.name += props.name; const ct = await site.contentTypes.add(ctTemplate); await site.contentTypes.getById(ct.data.id).delete(); return expect((ct.data.name === ctTemplate.name)).to.be.true; - }); + })); // potential long running function - not approrpriate for automated tests it.skip("addFromHub"); @@ -82,52 +92,77 @@ describe("ContentTypes", function () { it.skip("associateWithHub"); // Errors with ~ Metadata hub feature is disabled on this site. - it.skip("isPublished", async function () { + it.skip("isPublished", pnpTest("4c3b75f9-d46e-4ae4-a1b7-8ce7bb43009c", async function () { + + const props = await this.props({ + name: getRandomString(5) + "SiteIsPublished", + }); + const ctTemplate = JSON.parse(JSON.stringify(sampleContentType)); - ctTemplate.name += getRandomString(5) + "SiteIsPublished"; + ctTemplate.name += props.name; const ct = await site.contentTypes.add(ctTemplate); const isPublished = await ct.contentType.isPublished(); await site.contentTypes.getById(ct.data.id).delete(); return expect(isPublished).to.be.false; - }); + })); // Errors with ~ Metadata hub feature is disabled on this site. - it.skip("publish", async function () { + it.skip("publish", pnpTest("664acec7-ff46-4bbf-9352-16d0718767de", async function () { + + const props = await this.props({ + name: getRandomString(5) + "SitePublish", + }); + const ctTemplate = JSON.parse(JSON.stringify(sampleContentType)); - ctTemplate.name += getRandomString(5) + "SitePublish"; + ctTemplate.name += props.name; const ct = await site.contentTypes.add(ctTemplate); await ct.contentType.publish(); const isPublished = await ct.contentType.isPublished(); await site.contentTypes.getById(ct.data.id).delete(); return expect(isPublished).to.be.true; - }); + })); // Errors with ~ Metadata hub feature is disabled on this site. - it.skip("unpublish", async function () { + it.skip("unpublish", pnpTest("28cd50ea-5672-48fc-9fc1-842c9d69688b", async function () { + + const props = await this.props({ + name: getRandomString(5) + "SiteUnPublish", + }); + const ctTemplate = JSON.parse(JSON.stringify(sampleContentType)); - ctTemplate.name += getRandomString(5) + "SiteUnPublish"; + ctTemplate.name += props.name; const ct = await site.contentTypes.add(ctTemplate); await ct.contentType.publish(); await ct.contentType.unpublish(); const isPublished = await ct.contentType.isPublished(); await site.contentTypes.getById(ct.data.id).delete(); return expect(isPublished).to.be.false; - }); + })); + + it("update", pnpTest("41d3c22d-8632-4890-9ecf-7d0a367d739c", async function () { + + const props = await this.props({ + name: getRandomString(5) + "SiteUpdate", + }); - it("update", async function () { const ctTemplate = JSON.parse(JSON.stringify(sampleContentType)); - ctTemplate.name += getRandomString(5) + "SiteUpdate"; + ctTemplate.name += props.name; const newContentTypeName = `${ctTemplate.name}-CHANGED`; const ct = await site.contentTypes.add(ctTemplate); await site.contentTypes.getById(ct.data.id).update({ name: newContentTypeName }); const updateContentType = await site.contentTypes.getById(ct.data.id)(); await site.contentTypes.getById(ct.data.id).delete(); return expect((updateContentType.name === newContentTypeName)).to.be.true; - }); + })); + + it("delete", pnpTest("50a499b1-b6b9-47f7-b14e-567c03ac77a2", async function () { + + const props = await this.props({ + name: getRandomString(5) + "SiteDelete", + }); - it("delete", async function () { const ctTemplate = JSON.parse(JSON.stringify(sampleContentType)); - ctTemplate.name += getRandomString(5) + "SiteDelete"; + ctTemplate.name += props.name; const ct = await site.contentTypes.add(ctTemplate); await site.contentTypes.getById(ct.data.id).delete(); let deletedContentType: ContentType = null; @@ -137,16 +172,17 @@ describe("ContentTypes", function () { // do nothing } return expect(deletedContentType).to.be.null; - }); + })); }); describe("List", function () { - it("content types", async function () { + + it("content types", pnpTest("3ee007d0-e331-4842-bc8e-8251726d9d39", async function () { const ct = await list.contentTypes(); return expect(ct).to.be.an("array") && expect(ct[0]).to.haveOwnProperty("id"); - }); + })); - it("getById()", async function () { + it("getById()", pnpTest("ab0abf2f-4ffe-4d37-af4b-c8bdb8f2a257", async function () { let passed = true; const cts = await list.contentTypes(); if (cts.length > 0) { @@ -154,29 +190,39 @@ describe("ContentTypes", function () { passed = (ct.id === cts[0].id); } return expect(passed).is.true; - }); + })); - it("getCompatibleFromHub", async function () { + it("getCompatibleFromHub", pnpTest("c74f5186-5aff-4b18-b5b7-97edcd4bd6c5", async function () { const cts = await list.contentTypes.getCompatibleHubContentTypes(); return expect(cts).to.be.an("array"); - }); + })); // potential long running function - not approrpriate for automated tests it.skip("addFromHub"); - it("addCopy", async function () { + it("addCopy", pnpTest("ef5ebb3f-f8f1-4b57-a977-c3ad359365ca", async function () { + + const props = await this.props({ + name: getRandomString(5) + "ListAddCopy", + }); + const ctTemplate = JSON.parse(JSON.stringify(sampleContentType)); - ctTemplate.name += getRandomString(5) + "ListAddCopy"; + ctTemplate.name += props.name; const siteCT = await site.contentTypes.add(ctTemplate); const listCT = await list.contentTypes.addCopy(siteCT.contentType); await list.contentTypes.getById(listCT.data.id).delete(); await site.contentTypes.getById(siteCT.data.id).delete(); return expect((siteCT.data.name === listCT.data.name)).to.be.true; - }); + })); + + it("update", pnpTest("3add8b28-47ea-45a9-9db3-aa370e088f67", async function () { + + const props = await this.props({ + name: getRandomString(5) + "ListUpdate", + }); - it("update", async function () { const ctTemplate = JSON.parse(JSON.stringify(sampleContentType)); - ctTemplate.name += getRandomString(5) + "ListUpdate"; + ctTemplate.name += props.name; const newContentTypeName = `${ctTemplate.displayName}-CHANGED`; const siteCT = await site.contentTypes.add(ctTemplate); const listCT = await list.contentTypes.addCopy(siteCT.contentType); @@ -185,11 +231,16 @@ describe("ContentTypes", function () { await list.contentTypes.getById(listCT.data.id).delete(); await site.contentTypes.getById(siteCT.data.id).delete(); return expect((updateContentType.name === newContentTypeName)).to.be.true; - }); + })); + + it("delete", pnpTest("5d8dc8f0-5220-400b-b990-0bcdfcd08594", async function () { + + const props = await this.props({ + name: getRandomString(5) + "ListDelete", + }); - it("delete", async function () { const ctTemplate = JSON.parse(JSON.stringify(sampleContentType)); - ctTemplate.name += getRandomString(5) + "ListDelete"; + ctTemplate.name += props.name; const siteCT = await site.contentTypes.add(ctTemplate); const listCT = await list.contentTypes.addCopy(siteCT.contentType); await list.contentTypes.getById(listCT.data.id).delete(); @@ -201,6 +252,6 @@ describe("ContentTypes", function () { // do nothing } return expect(deletedContentType).to.be.null; - }); + })); }); }); diff --git a/test/graph/directoryobjects.ts b/test/graph/directoryobjects.ts index 9ed55e2ec..edcbf600d 100644 --- a/test/graph/directoryobjects.ts +++ b/test/graph/directoryobjects.ts @@ -5,103 +5,118 @@ import "@pnp/graph/directory-objects"; import { GroupType } from "@pnp/graph/groups"; import { getRandomString, getGUID, stringIsNullOrEmpty } from "@pnp/core"; import getValidUser from "./utilities/getValidUser.js"; +import { pnpTest } from "../pnp-test.js"; describe("Directory Objects", function () { let testUserName = ""; let testChildGroupID = ""; let testParentGroupID = ""; - const testGUID = getGUID(); - let userInfo = null; + let testGUID; + let userId = null; - before(async function () { + before(pnpTest("3adea3f7-de9b-4872-92c4-82f964a072a8", async function () { if (!this.pnp.settings.enableWebTests || stringIsNullOrEmpty(this.pnp.settings.testUser)) { this.skip(); } // Get a sample user - userInfo = await getValidUser.call(this); - testUserName = userInfo.userPrincipalName; + const userInfo = await getValidUser.call(this); + + const props = await this.props({ + groupName1: `TestGroup_${getRandomString(4)}`, + groupName2: `TestGroup_${getRandomString(4)}`, + userId: userInfo.id, + userName: userInfo.userPrincipalName, + testGuid: getGUID(), + }); + + testUserName = props.userName; + userId = props.userId; + testGUID = props.testGuid; // Create a test group to ensure we have a directory object - let groupName = `TestGroup_${getRandomString(4)}`; - let result = await this.pnp.graph.groups.add(groupName, groupName, GroupType.Security, { + + let result = await this.pnp.graph.groups.add(props.groupName1, props.groupName1, GroupType.Security, { "members@odata.bind": [ - "https://graph.microsoft.com/v1.0/users/" + userInfo.id, + "https://graph.microsoft.com/v1.0/users/" + props.userId, ], "owners@odata.bind": [ - "https://graph.microsoft.com/v1.0/users/" + userInfo.id, + "https://graph.microsoft.com/v1.0/users/" + props.userId, ], }); testChildGroupID = result.data.id; - groupName = `TestGroup_${getRandomString(4)}`; - result = await this.pnp.graph.groups.add(groupName, groupName, GroupType.Security, { + result = await this.pnp.graph.groups.add(props.groupName2, props.groupName2, GroupType.Security, { "members@odata.bind": [ - "https://graph.microsoft.com/v1.0/users/" + userInfo.id, + "https://graph.microsoft.com/v1.0/users/" + props.userId, "https://graph.microsoft.com/v1.0/groups/" + testChildGroupID, ], "owners@odata.bind": [ - "https://graph.microsoft.com/v1.0/users/" + userInfo.id, + "https://graph.microsoft.com/v1.0/users/" + props.userId, ], }); testParentGroupID = result.data.id; - }); + })); - it("delete", async function () { - const groupName = `TestGroup_${getRandomString(4)}`; - const result = await this.pnp.graph.groups.add(groupName, groupName, GroupType.Security, { + it("delete", pnpTest("e1d8a9b8-43c1-4c02-85b3-92ef980d0ee2", async function () { + + const props = await this.props({ + groupName: `TestGroup_${getRandomString(4)}`, + }); + + const result = await this.pnp.graph.groups.add(props.groupName, props.groupName, GroupType.Security, { "members@odata.bind": [ - "https://graph.microsoft.com/v1.0/users/" + userInfo.id, + "https://graph.microsoft.com/v1.0/users/" + userId, ], "owners@odata.bind": [ - "https://graph.microsoft.com/v1.0/users/" + userInfo.id, + "https://graph.microsoft.com/v1.0/users/" + userId, ], }); const testDeleteGroupID = result.data.id; return expect(this.pnp.graph.groups.getById(testDeleteGroupID).delete()).eventually.be.fulfilled; - }); + })); - it("Get User Member Objects", async function () { + it("Get User Member Objects", pnpTest("ba2c72fb-d9f0-412d-988e-527d0ce9b7a6", async function () { const memberObjects = await this.pnp.graph.users.getById(testUserName).getMemberObjects(); return expect(memberObjects).contains(testChildGroupID); - }); + })); - it("Get Group Member Objects", async function () { + it("Get Group Member Objects", pnpTest("37fe45e5-5c9b-4b45-a8a5-bd8536ecb512", async function () { const memberObjects = await this.pnp.graph.groups.getById(testChildGroupID).getMemberObjects(true); return expect(memberObjects).contains(testParentGroupID); - }); + })); - it("Get User Member Groups", async function () { + it("Get User Member Groups", pnpTest("a66c2661-e9c1-4880-a5cf-f85c04c1fc09", async function () { const memberObjects = await this.pnp.graph.users.getById(testUserName).getMemberGroups(true); return expect(memberObjects).contains(testChildGroupID); - }); + })); - it("Get Group Member Objects", async function () { + it("Get Group Member Objects", pnpTest("a41f6893-7942-4584-a688-5cdef1304329", async function () { const memberObjects = await this.pnp.graph.groups.getById(testChildGroupID).getMemberGroups(); return expect(memberObjects).contains(testParentGroupID); - }); + })); - it("Check User Member Groups (1)", async function () { + it("Check User Member Groups (1)", pnpTest("fff79512-3b81-4b1f-8de2-c8c65ff3985e", async function () { const memberGroups = await this.pnp.graph.users.getById(testUserName).checkMemberGroups([testChildGroupID, testParentGroupID, testGUID]); return expect(memberGroups.length).is.equal(2); - }); + })); - it("Check User Member Groups (2)", async function () { + it("Check User Member Groups (2)", pnpTest("02172c11-b086-4fb8-a70b-216d24f17d3d", async function () { const memberGroups = await this.pnp.graph.groups.getById(testChildGroupID).checkMemberGroups([testChildGroupID, testParentGroupID, testGUID]); return expect(memberGroups.length).is.equal(1); - }); + })); - it("Get directory object by ID", async function () { + it("Get directory object by ID", pnpTest("501eef0b-1cb8-4b1e-b716-0876114f677c", async function () { const dirObj = await this.pnp.graph.directoryObjects.getById(testChildGroupID); return expect(dirObj).is.not.null; - }); + })); - it("Check MemberOf", async function () { + it("Check MemberOf", pnpTest("cfcd853b-8cba-4fea-8d1d-16afc35ba392", async function () { const memberObjects = await this.pnp.graph.users.getById(testUserName).memberOf(); return expect(memberObjects.length).greaterThan(0); - }); + })); // Remove the test data we created after(async function () { diff --git a/test/graph/drive.ts b/test/graph/files.ts similarity index 99% rename from test/graph/drive.ts rename to test/graph/files.ts index 300835d93..4b4c267a4 100644 --- a/test/graph/drive.ts +++ b/test/graph/files.ts @@ -3,9 +3,9 @@ import * as path from "path"; import * as fs from "fs"; import findupSync from "findup-sync"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; import { getRandomString, stringIsNullOrEmpty } from "@pnp/core"; -import { IItemOptions } from "@pnp/graph/drive/types"; +import { IItemOptions } from "@pnp/graph/files/types"; // give ourselves a single reference to the projectRoot const projectRoot = path.resolve(path.dirname(findupSync("package.json"))); diff --git a/test/graph/groups.ts b/test/graph/groups.ts index b9704f59f..aefbba33a 100644 --- a/test/graph/groups.ts +++ b/test/graph/groups.ts @@ -2,6 +2,7 @@ import { getRandomString } from "@pnp/core"; import { expect } from "chai"; import { GroupType } from "@pnp/graph/groups"; import "@pnp/graph/sites/group"; +import { pnpTest } from "../pnp-test.js"; describe("Groups", function () { @@ -19,18 +20,26 @@ describe("Groups", function () { groupID = ""; }); - it("add", async function () { - const groupName = `TestGroup_${getRandomString(4)}`; - const groupAddResult = await this.pnp.graph.groups.add(groupName, groupName, GroupType.Office365); + it("add", pnpTest("022e5336-56a1-4bd3-80a2-74139f386e40", async function () { + + const props = await this.props({ + groupName: `TestGroup_${getRandomString(4)}`, + }); + + const groupAddResult = await this.pnp.graph.groups.add(props.groupName, props.groupName, GroupType.Office365); const group = await groupAddResult.group(); groupID = groupAddResult.data.id; return expect(group.displayName).is.not.undefined; - }); + })); + + it("delete", pnpTest("c6d59c80-332b-4d6d-8dbd-54c111cdcf12", async function () { + + const props = await this.props({ + groupName: `TestGroup_${getRandomString(4)}`, + }); - it("delete", async function () { // Create a new group - const groupName = `TestGroup_${getRandomString(4)}`; - const groupAddResult = await this.pnp.graph.groups.add(groupName, groupName, GroupType.Office365); + const groupAddResult = await this.pnp.graph.groups.add(props.groupName, props.groupName, GroupType.Office365); // Delete the group // Potential Bug. Delete is only available off of getByID await this.pnp.graph.groups.getById(groupAddResult.data.id).delete(); @@ -44,21 +53,29 @@ describe("Groups", function () { } }); return expect(groupExists).is.not.true; - }); + })); + + it("getById", pnpTest("ea5ae8ab-570c-48fc-b01f-331f3e6ad366", async function () { + + const props = await this.props({ + groupName: `TestGroup_${getRandomString(4)}`, + }); - it("getById", async function () { // Create a new group - const groupName = `TestGroup_${getRandomString(4)}`; - const groupAddResult = await this.pnp.graph.groups.add(groupName, groupName, GroupType.Office365); + const groupAddResult = await this.pnp.graph.groups.add(props.groupName, props.groupName, GroupType.Office365); // Get the group by ID const group = await this.pnp.graph.groups.getById(groupAddResult.data.id); return expect(group).is.not.undefined; - }); + })); + + it("update", pnpTest("d1845967-2d71-4995-90e0-58e8967a249a", async function () { + + const props = await this.props({ + groupName: `TestGroup_${getRandomString(4)}`, + }); - it("update", async function () { // Create a new group - const groupName = `TestGroup_${getRandomString(4)}`; - const groupAddResult = await this.pnp.graph.groups.add(groupName, groupName, GroupType.Office365); + const groupAddResult = await this.pnp.graph.groups.add(props.groupName, props.groupName, GroupType.Office365); groupID = groupAddResult.data.id; // Update the display name of the group @@ -69,10 +86,10 @@ describe("Groups", function () { // Get the group to check and see if the names are different const group = await this.pnp.graph.groups.getById(groupID)(); - return expect(groupName === group.displayName).is.not.true; - }); + return expect(props.groupName === group.displayName).is.not.true; + })); - it("sites.root.sites", async function () { + it("sites.root.sites", pnpTest("ae59d162-bb17-40f0-b606-a9b5bab3ec6c", async function () { // Find an existing group // This has to be tested on existing groups. On a newly created group, this returns an error often // "Resource provisioning is in progress. Please try again.". This is expected as the team site provisioning takes a few seconds when creating a new group @@ -83,9 +100,9 @@ describe("Groups", function () { const sitesPromise = this.pnp.graph.groups.getById(grpID).sites.root.sites(); return expect(sitesPromise).to.eventually.be.fulfilled; - }); + })); - it("sites.root", async function () { + it("sites.root", pnpTest("b5fce16b-aa14-40e3-98c5-28a828050c04", async function () { // Find an existing group const groups = await this.pnp.graph.groups(); const grpID = groups[0].id; @@ -94,32 +111,7 @@ describe("Groups", function () { const root = await this.pnp.graph.groups.getById(grpID).sites.root(); return expect(root).is.not.null; - }); - - // it("addFavorite()", async function () { - // // This is a user context function. Can't test in application context - // return expect(true).is.true; - // }); - // it("removeFavorite()", async function () { - // // This is a user context function. Can't test in application context - // return expect(true).is.true; - // }); - // it("resetUnseenCount()", async function () { - // // This is a user context function. Can't test in application context - // return expect(true).is.true; - // }); - // it("subscribeByMail()", async function () { - // // This is a user context function. Can't test in application context - // return expect(true).is.true; - // }); - // it("unsubscribeByMail()", async function () { - // // This is a user context function. Can't test in application context - // return expect(true).is.true; - // }); - // it("getCalendarView(start: Date, end: Date)", async function () { - // // This is a user context function. Can't test in application context - // return expect(true).is.true; - // }); + })); afterEach(async function () { if (groupID !== "") { diff --git a/test/graph/lists.ts b/test/graph/lists.ts index 7bd2a6700..fdbad017c 100644 --- a/test/graph/lists.ts +++ b/test/graph/lists.ts @@ -5,6 +5,7 @@ import { List } from "@microsoft/microsoft-graph-types"; import { ISite } from "@pnp/graph/sites"; import { getRandomString } from "@pnp/core"; import getTestingGraphSPSite from "./utilities/getTestingGraphSPSite.js"; +import { pnpTest } from "../pnp-test.js"; describe.only("Lists", function () { let site: ISite; @@ -22,12 +23,12 @@ describe.only("Lists", function () { site = await getTestingGraphSPSite(this); }); - it("lists", async function () { + it("lists", pnpTest("016307d3-a0e3-4c8c-94e8-4f1c8566ffbd", async function () { const lists = await site.lists(); return expect(lists).to.be.an("array") && expect(lists[0]).to.haveOwnProperty("id"); - }); + })); - it("getById()", async function () { + it("getById()", pnpTest("657e7fc0-bf7d-40ed-b903-d75fe0b91d65", async function () { let passed = true; const lists = await site.lists(); if (lists.length > 0) { @@ -35,30 +36,45 @@ describe.only("Lists", function () { passed = (list.id === lists[0].id); } return expect(passed).is.true; - }); + })); + + it("add", pnpTest("a5b3a404-53bb-4895-815d-6681cc36fe7f", async function () { + + const props = await this.props({ + displayName: getRandomString(5) + "Add", + }); - it("add", async function () { const listTemplate = JSON.parse(JSON.stringify(sampleList)); - listTemplate.displayName += getRandomString(5) + "Add"; + listTemplate.displayName += props.displayName; const list = await site.lists.add(listTemplate); await site.lists.getById(list.data.id).delete(); return expect((list.data.displayName === listTemplate.displayName)).to.be.true; - }); + })); + + it("update", pnpTest("a386a85a-03ce-4846-8ca8-2472075694f5", async function () { + + const props = await this.props({ + displayName: getRandomString(5) + "Update", + }); - it("update", async function () { const listTemplate = JSON.parse(JSON.stringify(sampleList)); - listTemplate.displayName += getRandomString(5) + "Update"; + listTemplate.displayName += props.displayName; const newListName = `${listTemplate.displayName}-CHANGED`; const list = await site.lists.add(listTemplate); await site.lists.getById(list.data.id).update({ displayName: newListName }); const updateList = await site.lists.getById(list.data.id)(); await site.lists.getById(list.data.id).delete(); return expect((updateList.displayName === newListName)).to.be.true; - }); + })); + + it("delete", pnpTest("3d070839-0713-4a3e-a718-f89bb378cbe1", async function () { + + const props = await this.props({ + displayName: getRandomString(5) + "Delete", + }); - it("delete", async function () { const listTemplate = JSON.parse(JSON.stringify(sampleList)); - listTemplate.displayName += getRandomString(5) + "Delete"; + listTemplate.displayName += props.displayName; const list = await site.lists.add(listTemplate); await site.lists.getById(list.data.id).delete(); let deletedList: List = null; @@ -68,5 +84,5 @@ describe.only("Lists", function () { // do nothing } return expect(deletedList).to.be.null; - }); + })); }); diff --git a/test/graph/paging.ts b/test/graph/paging.ts index 844a56a3c..49b3b601b 100644 --- a/test/graph/paging.ts +++ b/test/graph/paging.ts @@ -5,12 +5,12 @@ import "@pnp/graph/sites"; import "@pnp/graph/lists"; import getTestingGraphSPSite from "./utilities/getTestingGraphSPSite.js"; import { getRandomString } from "@pnp/core"; -import { graphPost, GraphQueryableCollection, IGraphQueryableCollection } from "@pnp/graph"; +import { graphPost, GraphCollection, IGraphCollection } from "@pnp/graph"; import { body } from "@pnp/queryable"; describe("Groups", function () { - let itemsCol: IGraphQueryableCollection; + let itemsCol: IGraphCollection; before(async function () { @@ -26,7 +26,7 @@ describe("Groups", function () { list: { "template": "genericList" }, }); - itemsCol = GraphQueryableCollection(site.lists.getById(listInfo.data.id), "items"); + itemsCol = GraphCollection(site.lists.getById(listInfo.data.id), "items"); for (let i = 0; i < 11; i++) { await graphPost(itemsCol, body({ @@ -41,7 +41,7 @@ describe("Groups", function () { const allUsers = []; - for await (const users of this.pnp.graph.users.top(20).select("displayName").paged()) { + for await (const users of this.pnp.graph.users.top(20).select("displayName")) { allUsers.push(...users); } @@ -56,7 +56,7 @@ describe("Groups", function () { const allGroups = []; - for await (const groups of this.pnp.graph.groups.top(20).select("displayName").paged()) { + for await (const groups of this.pnp.graph.groups.top(20).select("displayName")) { allGroups.push(...groups); } @@ -74,7 +74,7 @@ describe("Groups", function () { const allItems = []; - for await (const items of itemsCol.paged()) { + for await (const items of itemsCol) { allItems.push(...items); } diff --git a/test/graph/querable.ts b/test/graph/querable.ts index faeefbbe5..5c1e79bba 100644 --- a/test/graph/querable.ts +++ b/test/graph/querable.ts @@ -1,7 +1,7 @@ import { expect } from "chai"; import "@pnp/graph/sites/group"; import "@pnp/graph/users"; -import "@pnp/graph/drive"; +import "@pnp/graph/files"; import { Drive, Group } from "@microsoft/microsoft-graph-types"; import { hOP, stringIsNullOrEmpty } from "@pnp/core"; import getValidUser from "./utilities/getValidUser.js"; diff --git a/test/graph/sites.ts b/test/graph/sites.ts index 1cb20258f..b250f0424 100644 --- a/test/graph/sites.ts +++ b/test/graph/sites.ts @@ -30,8 +30,9 @@ describe("Sites", function () { site = await getTestingGraphSPSite(this); const tetssite = await site(); const url = new URL(tetssite.webUrl); - const siteByUrl = await this.pnp.graph.sites.getByUrl(url.hostname, url.pathname)(); - passed = (siteByUrl.webUrl.toLowerCase() === tetssite.webUrl.toLowerCase()); + const siteByUrl = await this.pnp.graph.sites.getByUrl(url.hostname, url.pathname); + const siteInfo = await siteByUrl(); + passed = (siteInfo.webUrl.toLowerCase() === tetssite.webUrl.toLowerCase()); return expect(passed).is.true; }); diff --git a/test/pnp-test.ts b/test/pnp-test.ts index 6fc4ba607..09ec4f191 100644 --- a/test/pnp-test.ts +++ b/test/pnp-test.ts @@ -15,6 +15,10 @@ interface IPnPTestFunc { export const PnPTestHeaderName = "X-PnP-TestId"; +// we use this to identify tests with duplicate ids, which will cause problems +// really just a safety measure for us +const idDupeTracker = []; + /** * Behavior used to inject the correct test id into the headers for each request * @@ -46,6 +50,12 @@ function PnPTestIdHeader(id: () => string): TimelinePipe { */ export function pnpTest(id: string, testFunc: (this: IPnPTestFuncThis) => any): IPnPTestFunc { + if (idDupeTracker.indexOf(id.toLowerCase()) > -1) { + throw Error(`Test id ${id} is already in use.`); + } + + idDupeTracker.push(id.toLowerCase()); + return async function (this: IPnPTestFuncThis, ...args: any[]) { this.pnpid = id; diff --git a/test/sp/batch.ts b/test/sp/batch.ts index f4d2f3e23..9e9c7e636 100644 --- a/test/sp/batch.ts +++ b/test/sp/batch.ts @@ -288,7 +288,7 @@ describe("Batching", function () { expect(p2).to.eventually.be.fulfilled; })); - it("Should rebase objects to allow queries on returned objects", pnpTest("d9535bc2-c59a-49ba-8666-b3d80510aca5", async function () { + it("Should rebase objects to allow queries on returned objects", pnpTest("5e17585b-ce83-4fd0-8392-1132069b5503", async function () { const props = await this.props({ listName: "BatchTestRebase", diff --git a/test/sp/items.ts b/test/sp/items.ts index 7a25217f0..42cb34e6e 100644 --- a/test/sp/items.ts +++ b/test/sp/items.ts @@ -2,7 +2,6 @@ import { getRandomString } from "@pnp/core"; import { expect } from "chai"; import "@pnp/sp/lists/web"; import "@pnp/sp/items/list"; -import "@pnp/sp/items/get-all"; import "@pnp/sp/batching"; import { IList } from "@pnp/sp/lists"; import testSPInvokables from "../test-invokable-props.js"; @@ -69,33 +68,17 @@ describe("Items", function () { return expect(list.items.getById(item.Id)()).to.eventually.be.fulfilled; }); - it("getPaged", async function () { - - let page = await list.items.top(2).getPaged(); - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - expect(page.hasNext).to.be.true; - expect(page.results.length).to.eql(2); - page = await page.getNext(); - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - expect(page.hasNext).to.be.true; - expect(page.results.length).to.eql(2); - }); - it("getAll", async function () { + const a = []; const itemCount = await list.select("ItemCount")().then(r => r.ItemCount); - const page = await list.items.getAll(); - return expect(page.length).to.eq(itemCount); + for await (const items of list.items) { + a.push(...items); + } + return expect(a.length).to.eq(itemCount); }); - it("getAll top(2)", async function () { - - const itemCount = await list.select("ItemCount")().then(r => r.ItemCount); - const page = await list.items.top(2).getAll(); - return expect(page.length).to.eq(itemCount); - }); - it("effectiveBasePermissions", async function () { const item = await list.items.top(1)().then(r => r[0]); diff --git a/test/test-recording.ts b/test/test-recording.ts index 88916868d..688fa3813 100644 --- a/test/test-recording.ts +++ b/test/test-recording.ts @@ -9,6 +9,9 @@ import { default as nodeFetch } from "node-fetch"; // TODO:: a way to record tests from the browser -> console.log what we would save in a file along with the generated filename +// PS to create Guids and put them on the clip board +// "pnpTest(""$(([guid]::NewGuid() | select Guid -expandproperty Guid | Out-String).Trim())"", " | Set-Clipboard + export interface IRecordingOptions { resolvedRecordingPath: string; resolvedTestSettingsPath: string; From 4c50c47149cee5f99706bcdc2025e0f4d29b74a2 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 28 Aug 2023 13:53:59 +0000 Subject: [PATCH 27/33] Fix up merging for changes to GraphQueryable --- package-lock.json | 4 ++-- packages/graph/files/types.ts | 2 +- packages/graph/list-item/types.ts | 11 +++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7e1fa8c0a..94936a2f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@pnp/monorepo", - "version": "3.17.0", + "version": "4.0.0-alpha0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@pnp/monorepo", - "version": "3.17.0", + "version": "4.0.0-alpha0", "license": "MIT", "devDependencies": { "@azure/identity": "3.2.4", diff --git a/packages/graph/files/types.ts b/packages/graph/files/types.ts index bea36b02f..705c4f69c 100644 --- a/packages/graph/files/types.ts +++ b/packages/graph/files/types.ts @@ -34,7 +34,7 @@ export class _Drive extends _GraphInstance { /** * Method for retrieving the related list resource, for use with SharePoint drives. - * @returns IGraphQueryableInstance + * @returns IGraphInstance */ public get list(): IGraphInstance { return GraphInstance(this, "list"); diff --git a/packages/graph/list-item/types.ts b/packages/graph/list-item/types.ts index a4c6866f9..57a66fdde 100644 --- a/packages/graph/list-item/types.ts +++ b/packages/graph/list-item/types.ts @@ -1,7 +1,6 @@ import { ListItem as IListItemEntity, ListItemVersion as IListItemVersion } from "@microsoft/microsoft-graph-types"; -import { _GraphQueryableCollection, graphInvokableFactory, _GraphQueryableInstance, IGraphQueryableCollection, GraphQueryableCollection } from "../graphqueryable.js"; +import { _GraphCollection, graphInvokableFactory, _GraphInstance, IGraphCollection, GraphCollection, graphPost } from "../graphqueryable.js"; import { defaultPath, deleteable, IDeleteable, updateable, IUpdateable, getById, IGetById } from "../decorators.js"; -import { graphPost } from "../operations.js"; import { body } from "@pnp/queryable"; /** @@ -9,13 +8,13 @@ import { body } from "@pnp/queryable"; */ @deleteable() @updateable() -export class _ListItem extends _GraphQueryableInstance { +export class _ListItem extends _GraphInstance { /** * Method for retrieving the versions of a list item. * @returns IListItemVersion */ - public get versions(): IGraphQueryableCollection { - return GraphQueryableCollection(this, "versions"); + public get versions(): IGraphCollection { + return GraphCollection(this, "versions"); } } export interface IListItem extends _ListItem, IDeleteable, IUpdateable { } @@ -27,7 +26,7 @@ export const ListItem = graphInvokableFactory(_ListItem); */ @defaultPath("items") @getById(ListItem) -export class _ListItems extends _GraphQueryableCollection{ +export class _ListItems extends _GraphCollection{ /** * Create a new list item as specified in the request body. * From af7b1ecdba411b32209f733a771a1f71476ddfcd Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 28 Aug 2023 14:15:27 +0000 Subject: [PATCH 28/33] Fix Mail endpoint WIP issues Fix issue with Drive Items Changes --- packages/graph/analytics/driveItems.ts | 6 +++--- packages/graph/analytics/types.ts | 3 +-- packages/graph/behaviors/paged.ts | 2 +- packages/graph/files/types.ts | 26 +++++++++++++------------- packages/graph/mail/funcs.ts | 9 ++------- packages/graph/mail/users.ts | 3 --- 6 files changed, 20 insertions(+), 29 deletions(-) diff --git a/packages/graph/analytics/driveItems.ts b/packages/graph/analytics/driveItems.ts index ca4ef9e6f..cf4d97d97 100644 --- a/packages/graph/analytics/driveItems.ts +++ b/packages/graph/analytics/driveItems.ts @@ -1,8 +1,8 @@ -import { _DriveItem } from "../drive/types.js"; -import { IAnalyticsOptions, analytics } from "./types.js"; +import { _DriveItem } from "../files/types.js"; +import { analytics } from "./types.js"; import { ItemAnalytics as IItemAnalytics } from "@microsoft/microsoft-graph-types"; -declare module "../drive/types" { +declare module "../files/types" { interface _DriveItem { analytics(analyticsOptions?: IAnalyticsOptions): Promise; } diff --git a/packages/graph/analytics/types.ts b/packages/graph/analytics/types.ts index dc2cdffd7..4337842ea 100644 --- a/packages/graph/analytics/types.ts +++ b/packages/graph/analytics/types.ts @@ -1,6 +1,5 @@ import { ItemAnalytics as IItemAnalytics } from "@microsoft/microsoft-graph-types"; -import { graphGet } from "../operations.js"; -import { GraphQueryable } from "../graphqueryable.js"; +import { GraphQueryable, graphGet } from "../graphqueryable.js"; export interface IAnalyticsOptions { timeRange: "allTime" | "lastSevenDays"; diff --git a/packages/graph/behaviors/paged.ts b/packages/graph/behaviors/paged.ts index b469a068a..7cae1886b 100644 --- a/packages/graph/behaviors/paged.ts +++ b/packages/graph/behaviors/paged.ts @@ -11,7 +11,7 @@ export interface IPagedResult { } /** - * A function that will take a collection defining IGraphQueryableCollection and return the count of items + * A function that will take a collection defining IGraphCollection and return the count of items * in that collection. Not all Graph collections support Count. * * @param col The collection to count diff --git a/packages/graph/files/types.ts b/packages/graph/files/types.ts index 705c4f69c..c6544f8d1 100644 --- a/packages/graph/files/types.ts +++ b/packages/graph/files/types.ts @@ -11,7 +11,7 @@ import { graphPost, graphPut, } from "../graphqueryable.js"; -import { Drive as IDriveType, DriveItem as IDriveItemType, ItemPreviewInfo as IDriveItemPreviewInfo, ItemAnalytics as IItemAnalytics } from "@microsoft/microsoft-graph-types"; +import { Drive as IDriveType, DriveItem as IDriveItemType, ItemPreviewInfo as IDriveItemPreviewInfo } from "@microsoft/microsoft-graph-types"; import { combine } from "@pnp/core"; import { defaultPath, getById, IGetById, deleteable, IDeleteable, updateable, IUpdateable } from "../decorators.js"; import { body, BlobParse, CacheNever, errorCheck, InjectHeaders } from "@pnp/queryable"; @@ -128,7 +128,7 @@ export class _Root extends _GraphInstance { /** * Search drive for items matching the query * @param query string, search parameter - * @returns IGraphQueryableCollection + * @returns IGraphCollection */ public search(query: string): IGraphCollection { return GraphCollection(this, `search(q='${query}')`); @@ -136,7 +136,7 @@ export class _Root extends _GraphInstance { /** * Method for retrieving thumbnails of the drive items. - * @returns IGraphQueryableCollection + * @returns IGraphCollection */ public get thumbnails(): IGraphCollection { return GraphCollection(this, "thumbnails"); @@ -207,7 +207,7 @@ export class _DriveItem extends _GraphInstance { /** * Method for retrieving thumbnails of the drive items. - * @returns IGraphQueryableCollection + * @returns IGraphCollection */ public get thumbnails(): IGraphCollection { return GraphCollection(this, "thumbnails"); @@ -347,15 +347,15 @@ export class _DriveItem extends _GraphInstance { return graphPost(DriveItem(this, "preview"), body(previewOptions)); } - /** - * Method for getting item analytics. Defaults to lastSevenDays. - * @param analyticsOptions - IAnalyticsOptions (Optional) - * @returns IGraphQueryableCollection - */ - public analytics(analyticsOptions?: IAnalyticsOptions): IGraphCollection { - const query = `analytics/${analyticsOptions ? analyticsOptions.timeRange : "lastSevenDays"}`; - return >GraphCollection(this, query); - } + // /** + // * Method for getting item analytics. Defaults to lastSevenDays. + // * @param analyticsOptions - IAnalyticsOptions (Optional) + // * @returns IGraphCollection + // */ + // public analytics(analyticsOptions?: IAnalyticsOptions): IGraphCollection { + // const query = `analytics/${analyticsOptions ? analyticsOptions.timeRange : "lastSevenDays"}`; + // return >GraphCollection(this, query); + // } } export interface IDriveItem extends _DriveItem, IDeleteable, IUpdateable { } export const DriveItem = graphInvokableFactory(_DriveItem); diff --git a/packages/graph/mail/funcs.ts b/packages/graph/mail/funcs.ts index 6bf0906ee..9e3fba5c8 100644 --- a/packages/graph/mail/funcs.ts +++ b/packages/graph/mail/funcs.ts @@ -1,11 +1,6 @@ -import { IGraphQueryable, GraphQueryableCollection, IGraphQueryableCollection } from "../graphqueryable.js"; -import { graphPost } from "../operations.js"; +import { IGraphQueryable, GraphCollection, graphPost } from "../graphqueryable.js"; import { body } from "@pnp/queryable"; -import { Message } from "@microsoft/microsoft-graph-types"; -// export interface IMessage extends Message { -// attachments: -// } /** * Get the occurrences, exceptions, and single instances of events in a calendar view defined by a time range, * from the user's default calendar, or from some other calendar of the user's @@ -16,5 +11,5 @@ import { Message } from "@microsoft/microsoft-graph-types"; * which is not included the typing and therefore will make the function unusable in that scenario. */ export function mailSend(this: IGraphQueryable, message: any): Promise { - return graphPost(GraphQueryableCollection(this, "mailSend"), body(message)); + return graphPost(GraphCollection(this, "mailSend"), body(message)); } diff --git a/packages/graph/mail/users.ts b/packages/graph/mail/users.ts index f8bc4cb35..6349a3146 100644 --- a/packages/graph/mail/users.ts +++ b/packages/graph/mail/users.ts @@ -1,8 +1,5 @@ -// import { addProp } from "@pnp/queryable"; import { _User } from "../users/types.js"; -// import { Calendar, ICalendar, IEvents, Events, Calendars, ICalendars } from "./types.js"; import { mailSend } from "./funcs.js"; -// import { IGraphQueryableCollection } from "../graphqueryable.js"; declare module "../users/types" { interface _User { From 5a6654af6890d15cd4c6253c873fc61dde036b1f Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 28 Aug 2023 14:29:36 +0000 Subject: [PATCH 29/33] Package Updates Going to start using code spell checker to fix any documentation spelling errors and comment spelling errors. --- .vscode/settings.json | 3 + package-lock.json | 1149 +++++++++++++++------------- package.json | 22 +- packages/azidjsclient/package.json | 4 +- packages/graph/files/types.ts | 10 - packages/graph/package.json | 4 +- 6 files changed, 647 insertions(+), 545 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index abe068e72..629e5f75c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,4 +14,7 @@ "typescript.validate.enable": true, "typescript.tsdk": "./node_modules/typescript/lib", "editor.tabSize": 4, + "cSpell.words": [ + "queryables" + ], } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 94936a2f3..593ab6d58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,9 @@ "version": "4.0.0-alpha0", "license": "MIT", "devDependencies": { - "@azure/identity": "3.2.4", + "@azure/identity": "3.3.0", "@azure/msal-node": "1.18.0", - "@microsoft/microsoft-graph-types": "2.35.0", + "@microsoft/microsoft-graph-types": "2.38.0", "@pnp/buildsystem": "3.1.0", "@types/chai": "4.3.5", "@types/chai-as-promised": "7.1.5", @@ -20,25 +20,25 @@ "@types/gulp": "4.0.13", "@types/mocha": "10.0.1", "@types/node": "16.11.7", - "@types/webpack": "5.28.1", + "@types/webpack": "5.28.2", "@types/yargs": "17.0.24", - "@typescript-eslint/eslint-plugin": "5.59.9", - "@typescript-eslint/parser": "5.59.9", - "chai": "4.3.7", + "@typescript-eslint/eslint-plugin": "6.4.1", + "@typescript-eslint/parser": "6.4.1", + "chai": "4.3.8", "chai-as-promised": "7.1.1", - "del-cli": "5.0.0", - "eslint": "8.45.0", + "del-cli": "5.0.1", + "eslint": "8.48.0", "findup-sync": "5.0.0", "mocha": "10.2.0", "msal": "1.4.18", - "node-fetch": "3.3.1", + "node-fetch": "3.3.2", "prettyjson": "1.2.5", "string-replace-loader": "3.1.0", - "tslib": "2.6.0", + "tslib": "2.6.2", "typescript": "4.5.5", "webpack": "5.88.2", "webpack-cli": "5.1.4", - "webpack-dev-server": "4.15.0", + "webpack-dev-server": "4.15.1", "yargs": "17.7.2" }, "engines": { @@ -67,16 +67,17 @@ } }, "node_modules/@azure/core-auth": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.4.0.tgz", - "integrity": "sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz", + "integrity": "sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==", "dev": true, "dependencies": { "@azure/abort-controller": "^1.0.0", + "@azure/core-util": "^1.1.0", "tslib": "^2.2.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" } }, "node_modules/@azure/core-client": { @@ -98,9 +99,9 @@ } }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.11.0.tgz", - "integrity": "sha512-nB4KXl6qAyJmBVLWA7SakT4tzpYZTCk4pvRBeI+Ye0WYSOrlTqlMhc4MSS/8atD3ufeYWdkN380LLoXlUUzThw==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.12.0.tgz", + "integrity": "sha512-+MnSB0vGZjszSzr5AW8z93/9fkDu2RLtWmAN8gskURq7EW2sSwqy8jZa0V26rjuBVkwhdA3Hw8z3VWoeBUOw+A==", "dev": true, "dependencies": { "@azure/abort-controller": "^1.0.0", @@ -130,9 +131,9 @@ } }, "node_modules/@azure/core-util": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.3.2.tgz", - "integrity": "sha512-2bECOUh88RvL1pMZTcc6OzfobBeWDBf5oBbhjIhT1MV9otMVWCzpOJkkiKtrnO88y5GGBelgY8At73KGAdbkeQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.4.0.tgz", + "integrity": "sha512-eGAyJpm3skVQoLiRqm/xPa+SXi/NPDdSHMxbRAz2lSprd+Zs+qrpQGQQ2VQ3Nttu+nSZR4XoYQC71LbEI7jsig==", "dev": true, "dependencies": { "@azure/abort-controller": "^1.0.0", @@ -143,13 +144,13 @@ } }, "node_modules/@azure/identity": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-3.2.4.tgz", - "integrity": "sha512-t63oyi2LAn+ZAehYA7SDlhJDd1J0eLO3a21mxTaJcXqKW/tbRbKmo/BeyyTIXbBaoeTFn0xnyQHyomwndTqKUA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-3.3.0.tgz", + "integrity": "sha512-gISa/dAAxrWt6F2WiDXZY0y2xY4MLlN2wkNW4cPuq5OgPQKLSkxLc4I2WR04puTfZyQZnpXbAapAMEj1b96fgg==", "dev": true, "dependencies": { "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", + "@azure/core-auth": "^1.5.0", "@azure/core-client": "^1.4.0", "@azure/core-rest-pipeline": "^1.1.0", "@azure/core-tracing": "^1.0.0", @@ -182,21 +183,21 @@ } }, "node_modules/@azure/msal-browser": { - "version": "2.38.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.38.0.tgz", - "integrity": "sha512-gxBh83IumHgEP9uMCm9pJLKLRwICMQTxG9TX3AytdNt3oLUI3tytm/szYD5u5zKJgSkhHvwFSM+NPnM04hYw3w==", + "version": "2.38.2", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.38.2.tgz", + "integrity": "sha512-71BeIn2we6LIgMplwCSaMq5zAwmalyJR3jFcVOZxNVfQ1saBRwOD+P77nLs5vrRCedVKTq8RMFhIOdpMLNno0A==", "dev": true, "dependencies": { - "@azure/msal-common": "13.2.0" + "@azure/msal-common": "13.3.0" }, "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-common": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.2.0.tgz", - "integrity": "sha512-rnstQ7Zgn3fSTKNQO+/YNV34/QXJs0vni7IA0/3QB1EEyrJg14xyRmTqlw9ta+pdSuT5OJwUP8kI3D/rBwUIBw==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.0.tgz", + "integrity": "sha512-/VFWTicjcJbrGp3yQP7A24xU95NiDMe23vxIU1U6qdRPFsprMDNUohMudclnd+WSHE4/McqkZs/nUU3sAKkVjg==", "dev": true, "engines": { "node": ">=0.8.0" @@ -216,18 +217,99 @@ "node": "10 || 12 || 14 || 16 || 18" } }, + "node_modules/@azure/msal-node/node_modules/@azure/msal-common": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.2.0.tgz", + "integrity": "sha512-rnstQ7Zgn3fSTKNQO+/YNV34/QXJs0vni7IA0/3QB1EEyrJg14xyRmTqlw9ta+pdSuT5OJwUP8kI3D/rBwUIBw==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/@babel/code-frame": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.10.tgz", + "integrity": "sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.5" + "@babel/highlight": "^7.22.10", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/helper-validator-identifier": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", @@ -238,13 +320,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.10.tgz", + "integrity": "sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -347,18 +429,18 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.1.tgz", - "integrity": "sha512-O7x6dMstWLn2ktjcoiNLDkAGG2EjveHL+Vvc+n0fXumkJYAcSqcVYKtwDU+hDZ0uDUsnUagSYaZrOLAYE8un1A==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.0.tgz", + "integrity": "sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", - "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -379,9 +461,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", - "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.48.0.tgz", + "integrity": "sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -435,9 +517,9 @@ } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", "dev": true, "engines": { "node": ">=6.0.0" @@ -463,19 +545,19 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@leichtgewicht/ip-codec": { @@ -485,9 +567,9 @@ "dev": true }, "node_modules/@microsoft/microsoft-graph-types": { - "version": "2.35.0", - "resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-types/-/microsoft-graph-types-2.35.0.tgz", - "integrity": "sha512-3jCQyKaYbNuzVG884SNuWKS19FPUxBwHfDAb3DqZWBwPYcX3HbDe2D22z9Ue+UV+JGuw917cH75RTSgrdnutFg==", + "version": "2.38.0", + "resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-types/-/microsoft-graph-types-2.38.0.tgz", + "integrity": "sha512-EXpTf/TFUb0EfBXiQ0rTmZf6fRgBn73lNfYdU2QKvqiMPQD/Cs2Gt+VmWVtK19F9Mf5Mt4bDTu5Ft0TGXOF8rA==", "dev": true }, "node_modules/@nodelib/fs.scandir": { @@ -628,9 +710,9 @@ "dev": true }, "node_modules/@types/eslint": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.0.tgz", - "integrity": "sha512-gsF+c/0XOguWgaOgvFs+xnnRqt9GwgTvIks36WpE6ueeI4KCEHHd8K/CKHqhOqrJKsYH8m27kRzQEvWXAwXUTw==", + "version": "8.44.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz", + "integrity": "sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==", "dev": true, "dependencies": { "@types/estree": "*", @@ -672,9 +754,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.35", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.35.tgz", - "integrity": "sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==", + "version": "4.17.36", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.36.tgz", + "integrity": "sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==", "dev": true, "dependencies": { "@types/node": "*", @@ -891,9 +973,9 @@ } }, "node_modules/@types/webpack": { - "version": "5.28.1", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.1.tgz", - "integrity": "sha512-qw1MqGZclCoBrpiSe/hokSgQM/su8Ocpl3L/YHE0L6moyaypg4+5F7Uzq7NgaPKPxUxUbQ4fLPLpDWdR27bCZw==", + "version": "5.28.2", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.2.tgz", + "integrity": "sha512-7tcxyrIOd7WGimZIcWU6pDsNh2edGGnwYExOvd3l/nMvuxqwVPrFXnnTbYCnplqV9BJoU7Mo2mfFtiH8CNFvYw==", "dev": true, "dependencies": { "@types/node": "*", @@ -926,32 +1008,33 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.9.tgz", - "integrity": "sha512-4uQIBq1ffXd2YvF7MAvehWKW3zVv/w+mSfRAu+8cKbfj3nwzyqJLNcZJpQ/WZ1HLbJDiowwmQ6NO+63nCA+fqA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz", + "integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.9", - "@typescript-eslint/type-utils": "5.59.9", - "@typescript-eslint/utils": "5.59.9", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/type-utils": "6.4.1", + "@typescript-eslint/utils": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -960,25 +1043,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.9.tgz", - "integrity": "sha512-FsPkRvBtcLQ/eVK1ivDiNYBjn3TGJdXy2fhXX+rc7czWl4ARwnpArwbihSOHI2Peg9WbtGHrbThfBUkZZGTtvQ==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz", + "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.59.9", - "@typescript-eslint/types": "5.59.9", - "@typescript-eslint/typescript-estree": "5.59.9", + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/typescript-estree": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -987,16 +1071,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.9.tgz", - "integrity": "sha512-8RA+E+w78z1+2dzvK/tGZ2cpGigBZ58VMEHDZtpE1v+LLjzrYGc8mMaTONSxKyEkz3IuXFM0IqYiGHlCsmlZxQ==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz", + "integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.9", - "@typescript-eslint/visitor-keys": "5.59.9" + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -1004,25 +1088,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.9.tgz", - "integrity": "sha512-ksEsT0/mEHg9e3qZu98AlSrONAQtrSTljL3ow9CGej8eRo7pe+yaC/mvTjptp23Xo/xIf2mLZKC6KPv4Sji26Q==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz", + "integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.9", - "@typescript-eslint/utils": "5.59.9", + "@typescript-eslint/typescript-estree": "6.4.1", + "@typescript-eslint/utils": "6.4.1", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1031,12 +1115,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.9.tgz", - "integrity": "sha512-uW8H5NRgTVneSVTfiCVffBb8AbwWSKg7qcA4Ot3JI3MPCJGsB4Db4BhvAODIIYE5mNj7Q+VJkK7JxmRhk2Lyjw==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz", + "integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -1044,21 +1128,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.9.tgz", - "integrity": "sha512-pmM0/VQ7kUhd1QyIxgS+aRvMgw+ZljB3eDb+jYyp6d2bC0mQWLzUDF+DLwCTkQ3tlNyVsvZRXjFyV0LkU/aXjA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz", + "integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.9", - "@typescript-eslint/visitor-keys": "5.59.9", + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -1071,42 +1155,41 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.9.tgz", - "integrity": "sha512-1PuMYsju/38I5Ggblaeb98TOoUvjhRvLpLa1DoTOFaLWqaXl/1iQ1eGurTXgBY58NUdtfTXKP5xBq7q9NDaLKg==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz", + "integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.9", - "@typescript-eslint/types": "5.59.9", - "@typescript-eslint/typescript-estree": "5.59.9", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/typescript-estree": "6.4.1", + "semver": "^7.5.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.9.tgz", - "integrity": "sha512-bT7s0td97KMaLwpEBckbzj/YohnvXtqbe2XgqNvTl6RJVakY5mvENOTPvw5u66nljfZxthESpDozs86U+oLY8Q==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz", + "integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.9", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.4.1", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -2013,9 +2096,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.21.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", - "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", + "version": "4.21.10", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", + "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", "dev": true, "funding": [ { @@ -2032,9 +2115,9 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001503", - "electron-to-chromium": "^1.4.431", - "node-releases": "^2.0.12", + "caniuse-lite": "^1.0.30001517", + "electron-to-chromium": "^1.4.477", + "node-releases": "^2.0.13", "update-browserslist-db": "^1.0.11" }, "bin": { @@ -2162,9 +2245,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001517", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", - "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==", + "version": "1.0.30001524", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001524.tgz", + "integrity": "sha512-Jj917pJtYg9HSJBF95HVX3Cdr89JUyLT4IZ8SvM5aDRni95swKgYi3TgYLH5hnGfPE/U1dg6IfZ50UsIlLkwSA==", "dev": true, "funding": [ { @@ -2182,9 +2265,9 @@ ] }, "node_modules/chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", + "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", @@ -2864,9 +2947,9 @@ } }, "node_modules/del-cli": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/del-cli/-/del-cli-5.0.0.tgz", - "integrity": "sha512-rENFhUaYcjoMODwFhhlON+ogN7DoG+4+GFN+bsA1XeDt4w2OKQnQadFP1thHSAlK9FAtl88qgP66wOV+eFZZiQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/del-cli/-/del-cli-5.0.1.tgz", + "integrity": "sha512-hCDHJd0u0jKFqizgInYXZaILsqOIA7Zl6e7M3hJwP+SlwUAgtV/EB22EPF4e2+9VAVnBDQQBE6tDRe+/UuoFhg==", "dev": true, "dependencies": { "del": "^7.0.0", @@ -2973,9 +3056,9 @@ "dev": true }, "node_modules/dns-packet": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.0.tgz", - "integrity": "sha512-rza3UH1LwdHh9qyPXp8lkwpjSNk/AMD3dPytUoRoqnypDUhY0xvbdmVhWOfxO68frEfV9BU8V12Ez7ZsHGZpCQ==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", + "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", "dev": true, "dependencies": { "@leichtgewicht/ip-codec": "^2.0.1" @@ -3046,9 +3129,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.468", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.468.tgz", - "integrity": "sha512-6M1qyhaJOt7rQtNti1lBA0GwclPH+oKCmsra/hkcWs5INLxfXXD/dtdnaKUYQu/pjOBP/8Osoe4mAcNvvzoFag==", + "version": "1.4.503", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.503.tgz", + "integrity": "sha512-LF2IQit4B0VrUHFeQkWhZm97KuJSGF2WJqq1InpY+ECpFRkXd8yTIaTtJxsO0OKDmiBYwWqcrNaXOurn2T2wiA==", "dev": true }, "node_modules/emoji-regex": { @@ -3200,27 +3283,27 @@ } }, "node_modules/eslint": { - "version": "8.45.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz", - "integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.48.0.tgz", + "integrity": "sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.1.0", - "@eslint/js": "8.44.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.48.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.6.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -3254,23 +3337,14 @@ } }, "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -3278,15 +3352,11 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.1.tgz", - "integrity": "sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA==", + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -3294,15 +3364,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -3353,15 +3414,6 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -3374,7 +3426,7 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { + "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", @@ -3383,15 +3435,6 @@ "node": ">=4.0" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -3899,16 +3942,17 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", + "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", "dev": true, "dependencies": { - "flatted": "^3.1.0", + "flatted": "^3.2.7", + "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=12.0.0" } }, "node_modules/flatted": { @@ -4060,9 +4104,9 @@ "dev": true }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -4617,9 +4661,9 @@ } }, "node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -4678,12 +4722,6 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -5752,9 +5790,9 @@ "dev": true }, "node_modules/is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -6067,6 +6105,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -6161,6 +6205,15 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/keyv": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", @@ -7243,12 +7296,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -7290,9 +7337,9 @@ } }, "node_modules/node-fetch": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", - "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, "dependencies": { "data-uri-to-buffer": "^4.0.0", @@ -8454,12 +8501,12 @@ "dev": true }, "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", "dev": true, "dependencies": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -9817,31 +9864,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tslib": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", - "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/ts-api-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", + "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, "engines": { - "node": ">= 6" + "node": ">=16.13.0" }, "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "typescript": ">=4.2.0" } }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "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/type": { @@ -10474,9 +10512,9 @@ } }, "node_modules/webpack-dev-server": { - "version": "4.15.0", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.0.tgz", - "integrity": "sha512-HmNB5QeSl1KpulTBQ8UT4FPrByYyaLxpJoQ0+s7EvUrMc16m0ZS1sgb1XGqzmgCPk0c9y+aaXxn11tbLzuM7NQ==", + "version": "4.15.1", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.1.tgz", + "integrity": "sha512-5hbAst3h3C3L8w6W4P96L5vaV0PxSmJhxZvWKYIdgxOQm8pNZ5dEOmmSLBVpP85ReeyRt6AS1QJNyo/oFFPeVA==", "dev": true, "dependencies": { "@types/bonjour": "^3.5.9", @@ -10485,7 +10523,7 @@ "@types/serve-index": "^1.9.1", "@types/serve-static": "^1.13.10", "@types/sockjs": "^0.3.33", - "@types/ws": "^8.5.1", + "@types/ws": "^8.5.5", "ansi-html-community": "^0.0.8", "bonjour-service": "^1.0.11", "chokidar": "^3.5.3", @@ -10607,6 +10645,28 @@ "node": ">=10.13.0" } }, + "node_modules/webpack/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/webpack/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/websocket-driver": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", @@ -10833,12 +10893,13 @@ } }, "@azure/core-auth": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.4.0.tgz", - "integrity": "sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz", + "integrity": "sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==", "dev": true, "requires": { "@azure/abort-controller": "^1.0.0", + "@azure/core-util": "^1.1.0", "tslib": "^2.2.0" } }, @@ -10858,9 +10919,9 @@ } }, "@azure/core-rest-pipeline": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.11.0.tgz", - "integrity": "sha512-nB4KXl6qAyJmBVLWA7SakT4tzpYZTCk4pvRBeI+Ye0WYSOrlTqlMhc4MSS/8atD3ufeYWdkN380LLoXlUUzThw==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.12.0.tgz", + "integrity": "sha512-+MnSB0vGZjszSzr5AW8z93/9fkDu2RLtWmAN8gskURq7EW2sSwqy8jZa0V26rjuBVkwhdA3Hw8z3VWoeBUOw+A==", "dev": true, "requires": { "@azure/abort-controller": "^1.0.0", @@ -10884,9 +10945,9 @@ } }, "@azure/core-util": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.3.2.tgz", - "integrity": "sha512-2bECOUh88RvL1pMZTcc6OzfobBeWDBf5oBbhjIhT1MV9otMVWCzpOJkkiKtrnO88y5GGBelgY8At73KGAdbkeQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.4.0.tgz", + "integrity": "sha512-eGAyJpm3skVQoLiRqm/xPa+SXi/NPDdSHMxbRAz2lSprd+Zs+qrpQGQQ2VQ3Nttu+nSZR4XoYQC71LbEI7jsig==", "dev": true, "requires": { "@azure/abort-controller": "^1.0.0", @@ -10894,13 +10955,13 @@ } }, "@azure/identity": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-3.2.4.tgz", - "integrity": "sha512-t63oyi2LAn+ZAehYA7SDlhJDd1J0eLO3a21mxTaJcXqKW/tbRbKmo/BeyyTIXbBaoeTFn0xnyQHyomwndTqKUA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-3.3.0.tgz", + "integrity": "sha512-gISa/dAAxrWt6F2WiDXZY0y2xY4MLlN2wkNW4cPuq5OgPQKLSkxLc4I2WR04puTfZyQZnpXbAapAMEj1b96fgg==", "dev": true, "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", + "@azure/core-auth": "^1.5.0", "@azure/core-client": "^1.4.0", "@azure/core-rest-pipeline": "^1.1.0", "@azure/core-tracing": "^1.0.0", @@ -10927,18 +10988,18 @@ } }, "@azure/msal-browser": { - "version": "2.38.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.38.0.tgz", - "integrity": "sha512-gxBh83IumHgEP9uMCm9pJLKLRwICMQTxG9TX3AytdNt3oLUI3tytm/szYD5u5zKJgSkhHvwFSM+NPnM04hYw3w==", + "version": "2.38.2", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.38.2.tgz", + "integrity": "sha512-71BeIn2we6LIgMplwCSaMq5zAwmalyJR3jFcVOZxNVfQ1saBRwOD+P77nLs5vrRCedVKTq8RMFhIOdpMLNno0A==", "dev": true, "requires": { - "@azure/msal-common": "13.2.0" + "@azure/msal-common": "13.3.0" } }, "@azure/msal-common": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.2.0.tgz", - "integrity": "sha512-rnstQ7Zgn3fSTKNQO+/YNV34/QXJs0vni7IA0/3QB1EEyrJg14xyRmTqlw9ta+pdSuT5OJwUP8kI3D/rBwUIBw==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.0.tgz", + "integrity": "sha512-/VFWTicjcJbrGp3yQP7A24xU95NiDMe23vxIU1U6qdRPFsprMDNUohMudclnd+WSHE4/McqkZs/nUU3sAKkVjg==", "dev": true }, "@azure/msal-node": { @@ -10950,15 +11011,82 @@ "@azure/msal-common": "13.2.0", "jsonwebtoken": "^9.0.0", "uuid": "^8.3.0" + }, + "dependencies": { + "@azure/msal-common": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.2.0.tgz", + "integrity": "sha512-rnstQ7Zgn3fSTKNQO+/YNV34/QXJs0vni7IA0/3QB1EEyrJg14xyRmTqlw9ta+pdSuT5OJwUP8kI3D/rBwUIBw==", + "dev": true + } } }, "@babel/code-frame": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.10.tgz", + "integrity": "sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA==", "dev": true, "requires": { - "@babel/highlight": "^7.22.5" + "@babel/highlight": "^7.22.10", + "chalk": "^2.4.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/helper-validator-identifier": { @@ -10968,13 +11096,13 @@ "dev": true }, "@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.10.tgz", + "integrity": "sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "dependencies": { @@ -11052,15 +11180,15 @@ } }, "@eslint-community/regexpp": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.1.tgz", - "integrity": "sha512-O7x6dMstWLn2ktjcoiNLDkAGG2EjveHL+Vvc+n0fXumkJYAcSqcVYKtwDU+hDZ0uDUsnUagSYaZrOLAYE8un1A==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.0.tgz", + "integrity": "sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==", "dev": true }, "@eslint/eslintrc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", - "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -11075,9 +11203,9 @@ } }, "@eslint/js": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", - "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.48.0.tgz", + "integrity": "sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==", "dev": true }, "@humanwhocodes/config-array": { @@ -11115,9 +11243,9 @@ } }, "@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", "dev": true }, "@jridgewell/set-array": { @@ -11137,19 +11265,19 @@ } }, "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@leichtgewicht/ip-codec": { @@ -11159,9 +11287,9 @@ "dev": true }, "@microsoft/microsoft-graph-types": { - "version": "2.35.0", - "resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-types/-/microsoft-graph-types-2.35.0.tgz", - "integrity": "sha512-3jCQyKaYbNuzVG884SNuWKS19FPUxBwHfDAb3DqZWBwPYcX3HbDe2D22z9Ue+UV+JGuw917cH75RTSgrdnutFg==", + "version": "2.38.0", + "resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-types/-/microsoft-graph-types-2.38.0.tgz", + "integrity": "sha512-EXpTf/TFUb0EfBXiQ0rTmZf6fRgBn73lNfYdU2QKvqiMPQD/Cs2Gt+VmWVtK19F9Mf5Mt4bDTu5Ft0TGXOF8rA==", "dev": true }, "@nodelib/fs.scandir": { @@ -11280,9 +11408,9 @@ "dev": true }, "@types/eslint": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.0.tgz", - "integrity": "sha512-gsF+c/0XOguWgaOgvFs+xnnRqt9GwgTvIks36WpE6ueeI4KCEHHd8K/CKHqhOqrJKsYH8m27kRzQEvWXAwXUTw==", + "version": "8.44.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz", + "integrity": "sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==", "dev": true, "requires": { "@types/estree": "*", @@ -11324,9 +11452,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.35", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.35.tgz", - "integrity": "sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==", + "version": "4.17.36", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.36.tgz", + "integrity": "sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==", "dev": true, "requires": { "@types/node": "*", @@ -11543,9 +11671,9 @@ } }, "@types/webpack": { - "version": "5.28.1", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.1.tgz", - "integrity": "sha512-qw1MqGZclCoBrpiSe/hokSgQM/su8Ocpl3L/YHE0L6moyaypg4+5F7Uzq7NgaPKPxUxUbQ4fLPLpDWdR27bCZw==", + "version": "5.28.2", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.2.tgz", + "integrity": "sha512-7tcxyrIOd7WGimZIcWU6pDsNh2edGGnwYExOvd3l/nMvuxqwVPrFXnnTbYCnplqV9BJoU7Mo2mfFtiH8CNFvYw==", "dev": true, "requires": { "@types/node": "*", @@ -11578,102 +11706,103 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.9.tgz", - "integrity": "sha512-4uQIBq1ffXd2YvF7MAvehWKW3zVv/w+mSfRAu+8cKbfj3nwzyqJLNcZJpQ/WZ1HLbJDiowwmQ6NO+63nCA+fqA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz", + "integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==", "dev": true, "requires": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.9", - "@typescript-eslint/type-utils": "5.59.9", - "@typescript-eslint/utils": "5.59.9", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/type-utils": "6.4.1", + "@typescript-eslint/utils": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/parser": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.9.tgz", - "integrity": "sha512-FsPkRvBtcLQ/eVK1ivDiNYBjn3TGJdXy2fhXX+rc7czWl4ARwnpArwbihSOHI2Peg9WbtGHrbThfBUkZZGTtvQ==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz", + "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.59.9", - "@typescript-eslint/types": "5.59.9", - "@typescript-eslint/typescript-estree": "5.59.9", + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/typescript-estree": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.9.tgz", - "integrity": "sha512-8RA+E+w78z1+2dzvK/tGZ2cpGigBZ58VMEHDZtpE1v+LLjzrYGc8mMaTONSxKyEkz3IuXFM0IqYiGHlCsmlZxQ==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz", + "integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.9", - "@typescript-eslint/visitor-keys": "5.59.9" + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1" } }, "@typescript-eslint/type-utils": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.9.tgz", - "integrity": "sha512-ksEsT0/mEHg9e3qZu98AlSrONAQtrSTljL3ow9CGej8eRo7pe+yaC/mvTjptp23Xo/xIf2mLZKC6KPv4Sji26Q==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz", + "integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.59.9", - "@typescript-eslint/utils": "5.59.9", + "@typescript-eslint/typescript-estree": "6.4.1", + "@typescript-eslint/utils": "6.4.1", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/types": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.9.tgz", - "integrity": "sha512-uW8H5NRgTVneSVTfiCVffBb8AbwWSKg7qcA4Ot3JI3MPCJGsB4Db4BhvAODIIYE5mNj7Q+VJkK7JxmRhk2Lyjw==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz", + "integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.9.tgz", - "integrity": "sha512-pmM0/VQ7kUhd1QyIxgS+aRvMgw+ZljB3eDb+jYyp6d2bC0mQWLzUDF+DLwCTkQ3tlNyVsvZRXjFyV0LkU/aXjA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz", + "integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.9", - "@typescript-eslint/visitor-keys": "5.59.9", + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/utils": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.9.tgz", - "integrity": "sha512-1PuMYsju/38I5Ggblaeb98TOoUvjhRvLpLa1DoTOFaLWqaXl/1iQ1eGurTXgBY58NUdtfTXKP5xBq7q9NDaLKg==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz", + "integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==", "dev": true, "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.9", - "@typescript-eslint/types": "5.59.9", - "@typescript-eslint/typescript-estree": "5.59.9", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/typescript-estree": "6.4.1", + "semver": "^7.5.4" } }, "@typescript-eslint/visitor-keys": { - "version": "5.59.9", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.9.tgz", - "integrity": "sha512-bT7s0td97KMaLwpEBckbzj/YohnvXtqbe2XgqNvTl6RJVakY5mvENOTPvw5u66nljfZxthESpDozs86U+oLY8Q==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz", + "integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.9", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.4.1", + "eslint-visitor-keys": "^3.4.1" } }, "@webassemblyjs/ast": { @@ -12387,14 +12516,14 @@ "dev": true }, "browserslist": { - "version": "4.21.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", - "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", + "version": "4.21.10", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", + "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001503", - "electron-to-chromium": "^1.4.431", - "node-releases": "^2.0.12", + "caniuse-lite": "^1.0.30001517", + "electron-to-chromium": "^1.4.477", + "node-releases": "^2.0.13", "update-browserslist-db": "^1.0.11" } }, @@ -12482,15 +12611,15 @@ } }, "caniuse-lite": { - "version": "1.0.30001517", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", - "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==", + "version": "1.0.30001524", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001524.tgz", + "integrity": "sha512-Jj917pJtYg9HSJBF95HVX3Cdr89JUyLT4IZ8SvM5aDRni95swKgYi3TgYLH5hnGfPE/U1dg6IfZ50UsIlLkwSA==", "dev": true }, "chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", + "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", "dev": true, "requires": { "assertion-error": "^1.1.0", @@ -13021,9 +13150,9 @@ } }, "del-cli": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/del-cli/-/del-cli-5.0.0.tgz", - "integrity": "sha512-rENFhUaYcjoMODwFhhlON+ogN7DoG+4+GFN+bsA1XeDt4w2OKQnQadFP1thHSAlK9FAtl88qgP66wOV+eFZZiQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/del-cli/-/del-cli-5.0.1.tgz", + "integrity": "sha512-hCDHJd0u0jKFqizgInYXZaILsqOIA7Zl6e7M3hJwP+SlwUAgtV/EB22EPF4e2+9VAVnBDQQBE6tDRe+/UuoFhg==", "dev": true, "requires": { "del": "^7.0.0", @@ -13082,9 +13211,9 @@ "dev": true }, "dns-packet": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.0.tgz", - "integrity": "sha512-rza3UH1LwdHh9qyPXp8lkwpjSNk/AMD3dPytUoRoqnypDUhY0xvbdmVhWOfxO68frEfV9BU8V12Ez7ZsHGZpCQ==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", + "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", "dev": true, "requires": { "@leichtgewicht/ip-codec": "^2.0.1" @@ -13148,9 +13277,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.4.468", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.468.tgz", - "integrity": "sha512-6M1qyhaJOt7rQtNti1lBA0GwclPH+oKCmsra/hkcWs5INLxfXXD/dtdnaKUYQu/pjOBP/8Osoe4mAcNvvzoFag==", + "version": "1.4.503", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.503.tgz", + "integrity": "sha512-LF2IQit4B0VrUHFeQkWhZm97KuJSGF2WJqq1InpY+ECpFRkXd8yTIaTtJxsO0OKDmiBYwWqcrNaXOurn2T2wiA==", "dev": true }, "emoji-regex": { @@ -13274,27 +13403,27 @@ "dev": true }, "eslint": { - "version": "8.45.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz", - "integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.48.0.tgz", + "integrity": "sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.1.0", - "@eslint/js": "8.44.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.48.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.6.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -13318,22 +13447,6 @@ "text-table": "^0.2.0" }, "dependencies": { - "eslint-scope": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.1.tgz", - "integrity": "sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, "glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -13352,19 +13465,19 @@ } }, "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "requires": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" } }, "eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true }, "espree": { @@ -13385,14 +13498,6 @@ "dev": true, "requires": { "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } } }, "esrecurse": { @@ -13402,20 +13507,12 @@ "dev": true, "requires": { "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } } }, "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, "esutils": { @@ -13838,12 +13935,13 @@ "dev": true }, "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", + "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", "dev": true, "requires": { - "flatted": "^3.1.0", + "flatted": "^3.2.7", + "keyv": "^4.5.3", "rimraf": "^3.0.2" } }, @@ -13960,9 +14058,9 @@ "dev": true }, "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "optional": true }, @@ -14406,9 +14504,9 @@ } }, "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -14451,12 +14549,6 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -15284,9 +15376,9 @@ "dev": true }, "is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "requires": { "has": "^1.0.3" @@ -15504,6 +15596,12 @@ "argparse": "^2.0.1" } }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -15590,6 +15688,15 @@ "safe-buffer": "^5.0.1" } }, + "keyv": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", @@ -16434,12 +16541,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -16465,9 +16566,9 @@ "dev": true }, "node-fetch": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", - "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, "requires": { "data-uri-to-buffer": "^4.0.0", @@ -17331,12 +17432,12 @@ "dev": true }, "resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", "dev": true, "requires": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -18405,29 +18506,19 @@ "integrity": "sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ==", "dev": true }, + "ts-api-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", + "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", + "dev": true, + "requires": {} + }, "tslib": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", - "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } - } - }, "type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", @@ -18801,6 +18892,24 @@ "terser-webpack-plugin": "^5.3.7", "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" + }, + "dependencies": { + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + } } }, "webpack-cli": { @@ -18893,9 +19002,9 @@ } }, "webpack-dev-server": { - "version": "4.15.0", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.0.tgz", - "integrity": "sha512-HmNB5QeSl1KpulTBQ8UT4FPrByYyaLxpJoQ0+s7EvUrMc16m0ZS1sgb1XGqzmgCPk0c9y+aaXxn11tbLzuM7NQ==", + "version": "4.15.1", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.1.tgz", + "integrity": "sha512-5hbAst3h3C3L8w6W4P96L5vaV0PxSmJhxZvWKYIdgxOQm8pNZ5dEOmmSLBVpP85ReeyRt6AS1QJNyo/oFFPeVA==", "dev": true, "requires": { "@types/bonjour": "^3.5.9", @@ -18904,7 +19013,7 @@ "@types/serve-index": "^1.9.1", "@types/serve-static": "^1.13.10", "@types/sockjs": "^0.3.33", - "@types/ws": "^8.5.1", + "@types/ws": "^8.5.5", "ansi-html-community": "^0.0.8", "bonjour-service": "^1.0.11", "chokidar": "^3.5.3", diff --git a/package.json b/package.json index c2ff3b2bc..2873576b2 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "version": "4.0.0-alpha0", "description": "A JavaScript library for SharePoint & Graph development.", "devDependencies": { - "@azure/identity": "3.2.4", + "@azure/identity": "3.3.0", "@azure/msal-node": "1.18.0", - "@microsoft/microsoft-graph-types": "2.35.0", + "@microsoft/microsoft-graph-types": "2.38.0", "@pnp/buildsystem": "3.1.0", "@types/chai": "4.3.5", "@types/chai-as-promised": "7.1.5", @@ -16,25 +16,25 @@ "@types/gulp": "4.0.13", "@types/mocha": "10.0.1", "@types/node": "16.11.7", - "@types/webpack": "5.28.1", + "@types/webpack": "5.28.2", "@types/yargs": "17.0.24", - "@typescript-eslint/eslint-plugin": "5.59.9", - "@typescript-eslint/parser": "5.59.9", - "chai": "4.3.7", + "@typescript-eslint/eslint-plugin": "6.4.1", + "@typescript-eslint/parser": "6.4.1", + "chai": "4.3.8", "chai-as-promised": "7.1.1", - "del-cli": "5.0.0", - "eslint": "8.45.0", + "del-cli": "5.0.1", + "eslint": "8.48.0", "findup-sync": "5.0.0", "mocha": "10.2.0", "msal": "1.4.18", - "node-fetch": "3.3.1", + "node-fetch": "3.3.2", "prettyjson": "1.2.5", "string-replace-loader": "3.1.0", - "tslib": "2.6.0", + "tslib": "2.6.2", "typescript": "4.5.5", "webpack": "5.88.2", "webpack-cli": "5.1.4", - "webpack-dev-server": "4.15.0", + "webpack-dev-server": "4.15.1", "yargs": "17.7.2" }, "scripts": { diff --git a/packages/azidjsclient/package.json b/packages/azidjsclient/package.json index eb9240c82..32bfc2d1c 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": "3.2.4", - "tslib": "2.6.0" + "@azure/identity": "3.3.0", + "tslib": "2.6.2" } } \ No newline at end of file diff --git a/packages/graph/files/types.ts b/packages/graph/files/types.ts index c6544f8d1..afb91b796 100644 --- a/packages/graph/files/types.ts +++ b/packages/graph/files/types.ts @@ -346,16 +346,6 @@ export class _DriveItem extends _GraphInstance { public async preview(previewOptions?: IPreviewOptions): Promise { return graphPost(DriveItem(this, "preview"), body(previewOptions)); } - - // /** - // * Method for getting item analytics. Defaults to lastSevenDays. - // * @param analyticsOptions - IAnalyticsOptions (Optional) - // * @returns IGraphCollection - // */ - // public analytics(analyticsOptions?: IAnalyticsOptions): IGraphCollection { - // const query = `analytics/${analyticsOptions ? analyticsOptions.timeRange : "lastSevenDays"}`; - // return >GraphCollection(this, query); - // } } export interface IDriveItem extends _DriveItem, IDeleteable, IUpdateable { } export const DriveItem = graphInvokableFactory(_DriveItem); diff --git a/packages/graph/package.json b/packages/graph/package.json index dc70e10d0..7c9730e62 100644 --- a/packages/graph/package.json +++ b/packages/graph/package.json @@ -8,8 +8,8 @@ "postinstall": "node ./post-install.cjs" }, "dependencies": { - "@microsoft/microsoft-graph-types": "2.35.0", - "tslib": "2.6.0", + "@microsoft/microsoft-graph-types": "2.38.0", + "tslib": "2.6.2", "@pnp/core": "0.0.0-PLACEHOLDER", "@pnp/queryable": "0.0.0-PLACEHOLDER" } From af2b1bf7bf74d8b184d5c28642cbf932a58315a9 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 28 Aug 2023 14:33:11 +0000 Subject: [PATCH 30/33] Remove onedrive file left; fix to queryable spelling --- docs/graph/onedrive.md | 0 packages/queryable/queryable.ts | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 docs/graph/onedrive.md diff --git a/docs/graph/onedrive.md b/docs/graph/onedrive.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/queryable/queryable.ts b/packages/queryable/queryable.ts index d30904fbe..942284115 100644 --- a/packages/queryable/queryable.ts +++ b/packages/queryable/queryable.ts @@ -33,7 +33,7 @@ export type QueryableInit = Queryable | string | [Queryable, string]; @invokable() export class Queryable extends Timeline implements IQueryableInternal { - // tracks any query paramters which will be appended to the request url + // tracks any query parameters which will be appended to the request url private _query: URLSearchParams; // tracks the current url for a given Queryable @@ -52,7 +52,7 @@ export class Queryable extends Timeline implements IQu this._query = new URLSearchParams(); - // add an intneral moment with specific implementaion for promise creation + // add an internal moment with specific implementation for promise creation this.moments[this.InternalPromise] = reduce(); let parent: Queryable; From b30eb990562a4d8b5c687fc5bc39b471d8537fe5 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 28 Aug 2023 14:43:06 +0000 Subject: [PATCH 31/33] Fix merge conflicts --- packages/graph/files/types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/graph/files/types.ts b/packages/graph/files/types.ts index afb91b796..e07ae8a2c 100644 --- a/packages/graph/files/types.ts +++ b/packages/graph/files/types.ts @@ -347,6 +347,7 @@ export class _DriveItem extends _GraphInstance { return graphPost(DriveItem(this, "preview"), body(previewOptions)); } } + export interface IDriveItem extends _DriveItem, IDeleteable, IUpdateable { } export const DriveItem = graphInvokableFactory(_DriveItem); From 455b332b1baee41f55f07decfe392744a29d03ca Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 28 Aug 2023 14:47:29 +0000 Subject: [PATCH 32/33] Remove IAnaltyicsOptions because it moved. --- packages/graph/files/types.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/graph/files/types.ts b/packages/graph/files/types.ts index e07ae8a2c..76c51d907 100644 --- a/packages/graph/files/types.ts +++ b/packages/graph/files/types.ts @@ -469,7 +469,3 @@ export interface IDeltaItems { delta: IGraphCollection; values: any[]; } - -export interface IAnalyticsOptions { - timeRange: "allTime" | "lastSevenDays"; -} From ee801c584b34515cffc51519ef2d71391e777ab4 Mon Sep 17 00:00:00 2001 From: Julie Turner Date: Mon, 28 Aug 2023 14:49:04 +0000 Subject: [PATCH 33/33] Fix Analytics import --- packages/graph/analytics/driveItems.ts | 2 +- packages/graph/files/index.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/graph/analytics/driveItems.ts b/packages/graph/analytics/driveItems.ts index cf4d97d97..719b5188d 100644 --- a/packages/graph/analytics/driveItems.ts +++ b/packages/graph/analytics/driveItems.ts @@ -1,5 +1,5 @@ import { _DriveItem } from "../files/types.js"; -import { analytics } from "./types.js"; +import { analytics, IAnalyticsOptions } from "./types.js"; import { ItemAnalytics as IItemAnalytics } from "@microsoft/microsoft-graph-types"; declare module "../files/types" { diff --git a/packages/graph/files/index.ts b/packages/graph/files/index.ts index 8e7bf5ef4..9f93e61a6 100644 --- a/packages/graph/files/index.ts +++ b/packages/graph/files/index.ts @@ -31,7 +31,6 @@ export { IDeltaItems, IPreviewOptions, IFileOptions, - IAnalyticsOptions, } from "./types.js"; declare module "../fi" {