pnpjs | Fluent JavaScript API for SharePoint and Microsoft Graph | Content Management System library

 by   pnp TypeScript Version: v2.11.0 License: Non-SPDX

kandi X-RAY | pnpjs Summary

kandi X-RAY | pnpjs Summary

pnpjs is a TypeScript library typically used in Web Site, Content Management System, React, Nodejs applications. pnpjs has no bugs, it has no vulnerabilities and it has low support. However pnpjs has a Non-SPDX License. You can download it from GitHub.

PnPjs is a fluent JavaScript API for consuming SharePoint and Microsoft Graph REST APIs in a type-safe way. You can use it with SharePoint Framework, Nodejs, or JavaScript projects. This an open source initiative complementing existing SDKs provided by Microsoft. Please use for the latest updates around the whole SharePoint Patterns and Practices (PnP) initiative. If you are moving from v1 please review the transition guide.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              pnpjs has a low active ecosystem.
              It has 669 star(s) with 284 fork(s). There are 44 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 18 open issues and 1655 have been closed. On average issues are closed in 11 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of pnpjs is v2.11.0

            kandi-Quality Quality

              pnpjs has no bugs reported.

            kandi-Security Security

              pnpjs has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              pnpjs has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              pnpjs releases are not available. You will need to build from source code and install.
              Installation instructions are available. Examples and code snippets are not available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pnpjs
            Get all kandi verified functions for this library.

            pnpjs Key Features

            No Key Features are available at this moment for pnpjs.

            pnpjs Examples and Code Snippets

            No Code Snippets are available at this moment for pnpjs.

            Community Discussions

            QUESTION

            Retrieve ID after pushing to SharePoint list using React PNPJs
            Asked 2021-Jun-02 at 06:07

            I'm building a SharePoint SPFx react app. In a nutshell, the user fills out a form that I created. When the user hit's submit, using PNPJs: https://pnp.github.io/pnpjs/sp/items/ I'm adding the item to a list called Request.

            From there I want to send an email that contains the URL link to that item they created. Right now, my code adds the item to the list and I'm able to send an email with no problem. However, I want to get the ID of the item that was just added to the list, so that I can add it to the email.

            Here is a striped down snippet of my function that adds items to the Request list.

            ...

            ANSWER

            Answered 2021-Jun-02 at 06:07

            You could retrieve the Id of the item like this:

            Source https://stackoverflow.com/questions/67795738

            QUESTION

            How to tell if a Principal Id is a permission group or a single user?
            Asked 2021-May-27 at 08:14

            I'm using pnpJS to list all the users who have permissions on an SPO item:

            ...

            ANSWER

            Answered 2021-May-26 at 19:59

            Looking at the info data and it doesn't seem to provide any differentiators.

            What you could potentially do to deal with this data is to add try / catch blocks and go on with whatever functionality you need, and get a list of actual users as you loop through.

            // Certainly feels hacky but see if it helps

            Source https://stackoverflow.com/questions/67711058

            QUESTION

            Hot to retrieve the Sparepoint Guid by given ItemId
            Asked 2021-May-14 at 06:25

            I am wondering whether there is way to retrieve the Guid (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) from an given ItemId (eg. ItemID=1969 as in query params in https://xyz.sharepoint.com/path/to/documents/image.jpg?ItemID=1969&ItemVersion=5.0) with pnpjs under nodejs. The docs do not describe how to do that but there might be a way to use a "back-door" to achieve this. I would like to do something similar like:

            ...

            ANSWER

            Answered 2021-May-13 at 12:05

            I think you should use "GUID" instead of "UniqueId" see this link and find this part of the documentation.

            Retrieve specific list item The following example shows how to retrieve a specific list item.

            HTTP GET

            Source https://stackoverflow.com/questions/67516276

            QUESTION

            SharePoint Online - SPFx - How to use GroupBy in PnPjs
            Asked 2021-Mar-15 at 08:18

            I am new to SPFx PnPjs. I want to use GroupBy in query but not seeing intellisense in visual code. Here is my query :

            ...

            ANSWER

            Answered 2021-Mar-13 at 08:25

            There are no way to user GroupBy in pnp js, because it not exists.

            But, you can grouping data after you get it in javascript.

            For example, you have some interface to store result data, somthing like this:

            Source https://stackoverflow.com/questions/66600121

            QUESTION

            How to use @pnp/sp to query a person column in an SP list to get the name
            Asked 2020-Oct-16 at 13:44

            I have a web part that which needs to retrieve the Name property of a person column (a people picker) so I can populate state with it and subsequently populate a field. Here's the function that queries the item:

            ...

            ANSWER

            Answered 2020-Oct-16 at 13:44

            QUESTION

            How to use pnp-js at a node.js application to fetch data from sharepoint?
            Asked 2020-Sep-25 at 11:22

            I got a node.js application and I'm trying to use the AdalFetchClient of PnPjs to fetch some data from sharepoint.

            ...

            ANSWER

            Answered 2020-Sep-25 at 11:22

            I found the solution. There is a AdalCertificateFetchClient which requires the following paramters:

            • Tenant-ID
            • Azure App Client ID
            • Thumbprint of your x.509 certificate
            • The private key of your x.509 certificate
            • The root url of the sharepoint you want to connect to

            So first of all you have to create a x.509 certificate. I used this tutorial for this. (Thanks for that)

            After that you have to get your thumbprint by installing the certificate to your local machine and following this steps

            Last step is to get your private key of your certificate. For that you have to install openssl for windows and follow this steps

            Now you can use your AdalCertificateFetchClient

            Source https://stackoverflow.com/questions/64047433

            QUESTION

            How to upload multiple files to an SP list item as attachments
            Asked 2020-Aug-12 at 08:02

            I am creating an SP webpart using SPFX. The webpart needs to be able to upload multiple files either using one button or several buttons (one for each file).

            I am trying to use this: https://pnp.github.io/pnpjs/sp/attachments/#add-multiple

            But it doesn't show how to use it with React states. You see, I want to be able to save the file upload into state, so it can then be submitted using a button. That's when it is attached to the list item in SP. I then want the webpart to be able to display the attached item when the user clicks back on this item. This is why I need to use state.

            I have read this: React SPFx - Adding files to SharePoint list field using PnPjs

            and this: Handling file upload in Sharepoint List with React form

            But they are not clear.

            Can someone provide an example of how to use the pnpjs attachments with a React component class using state?

            ...

            ANSWER

            Answered 2020-Aug-11 at 09:57

            My test code for your reference:

            Source https://stackoverflow.com/questions/63342798

            QUESTION

            PnPJS update items - List data validation failed
            Asked 2020-Jul-29 at 19:11

            We loaded a SP list directly from an Access query and now when we try to run a list update with pnpjs I get an "Error code: -2130575163.List data validation failed" .

            There are no required fields, no validation on any columns, and no Validation settings on the list. Is this not working because it was uploaded from Access?

            Updating it similar to this:

            ...

            ANSWER

            Answered 2020-Jul-03 at 23:39

            QUESTION

            What is the equivalent of ItemAddResult in @pnp/sp?
            Asked 2020-Jun-30 at 10:22

            I'm getting 'node_modules/@pnp/sp has no exported member 'ItemAddResult'' when I'm importing ItemAddResult at the top of a SharePoint Sfpx webpart:

            import { sp, ItemAddResult, AttachmentFileInfo } from "@pnp/sp";

            I'm also getting the same message for: AttachmentFileInfo.

            In the docs it suggests to import ItemAddResult: https://pnp.github.io/pnpjs/v1/sp/docs/items/#add-items

            Now that the old sp-pnp-js library has been deprecated, I'm forced(?) to use this new library.

            I've run npm install on the project dir.

            Any guidance appreciated.

            ...

            ANSWER

            Answered 2020-Jun-30 at 10:22

            Since v2 use import { IItemAddResult } from "@pnp/sp/items";

            Please have a look to the docs: Add Items

            Source https://stackoverflow.com/questions/62551936

            QUESTION

            Exporting a PPTX to PDF in Sharepoint Online with PnPjs and .pdfConversionUrl
            Asked 2020-May-06 at 18:53

            We are interacting with Sharepoint Online's Document Library through the PnPjs framework and by using a Sharepoint App Add-In (For one reason or another, we can't use Graph API at this time)

            Our add-in has full control of our site:

            ...

            ANSWER

            Answered 2020-May-06 at 18:53

            Found my issue- my CAML query was wrong. It should have been this:

            Source https://stackoverflow.com/questions/61637639

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install pnpjs

            Please see the Getting Started guide in the main documentation.

            Support

            Please review the documentation for the PnPjs libraries. This site is updated with each release. If cannot find what you need, please let us know by logging an documentation request.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/pnp/pnpjs.git

          • CLI

            gh repo clone pnp/pnpjs

          • sshUrl

            git@github.com:pnp/pnpjs.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Content Management System Libraries

            Try Top Libraries by pnp

            PnP

            by pnpC#

            sp-dev-fx-webparts

            by pnpTypeScript

            List-Formatting

            by pnpTypeScript

            cli-microsoft365

            by pnpTypeScript