diff --git a/docs/authentication/adaljsclient.md b/docs/authentication/adaljsclient.md index e46416d70..54cc42332 100644 --- a/docs/authentication/adaljsclient.md +++ b/docs/authentication/adaljsclient.md @@ -1,7 +1,6 @@ # @pnp/common/adalclient -This module contains the AdalClient class which can be used to authenticate to any AzureAD secured resource. It is designed to work seamlessly with -SharePoint Framework's permissions. +This module contains the AdalClient class which can be used to authenticate to any AzureAD secured resource. It is designed to work seamlessly with SharePoint Framework's permissions. > Where possible it is recommended to use the [MSAL client](./msaljsclient.md). @@ -13,7 +12,7 @@ Install the library and required dependencies ## Setup and Use inside SharePoint Framework -Using the SharePoint Framework is the preferred way to make use of the AdalClient as we can use the AADTokenProvider to efficiently get tokens on your behalf. You can also read more about how this process works and the necessary SPFx configurations in the [SharePoint Framework 1.6 release notes](https://github.com/SharePoint/sp-dev-docs/wiki/SharePoint-Framework-v1.6-release-notes#moving-from-beta-to-public---webapi). This method only work for SharePoint Framework >= 1.6. For earlier versions of SharePoint Framework you can still use the AdalClient as outlined above using the constructor to specify the values for an AAD Application you have setup. +Using the SharePoint Framework is the preferred way to make use of the AdalClient as we can use the AADTokenProvider to efficiently get tokens on your behalf. You can also read more about how this process works and the necessary SPFx configurations in the [SharePoint Framework 1.6 release notes](https://github.com/SharePoint/sp-dev-docs/wiki/SharePoint-Framework-v1.6-release-notes#moving-from-beta-to-public---webapi). This method will only work for SharePoint Framework >= 1.6. For earlier versions of SharePoint Framework you can still use the AdalClient as outlined below using the constructor to specify the values for an AAD Application you have setup. ### Calling the graph api @@ -54,7 +53,7 @@ public render(): void { #### Calling the SharePoint API -This example shows how to use the ADALClient with the @pnp/sp library to call an API secured with AAD from within SharePoint framework. +This example shows how to use the ADALClient with the @pnp/sp library to call an API secured with AAD from within SharePoint Framework. ```TypeScript import { SPFxAdalClient } from "@pnp/common"; diff --git a/docs/authentication/client-spa.md b/docs/authentication/client-spa.md index 7a5af305f..90f05617b 100644 --- a/docs/authentication/client-spa.md +++ b/docs/authentication/client-spa.md @@ -1,6 +1,6 @@ # Authentication in Single Page Application -If you are writing a single page appliation deployed outside SharePoint it is recommended to use the MSAL client. You can find further details on the settings in the [MSAL docs](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview). You will need to ensure that you grant the permissions required to the application you are trying to use. +If you are writing a single page application deployed outside SharePoint it is recommended to use the MSAL client. You can find further details on the settings in the [MSAL docs](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview). You will need to ensure that you grant the permissions required to the application you are trying to use. ```TypeScript import { MsalClientSetup } from "@pnp/msaljsclient"; diff --git a/docs/authentication/client-spfx.md b/docs/authentication/client-spfx.md index 1d25dd998..346bec62a 100644 --- a/docs/authentication/client-spfx.md +++ b/docs/authentication/client-spfx.md @@ -2,7 +2,7 @@ ## Auth as Current User -PnPjs is designed to work as easily as possible within SharePoint framework so the authentication setup is very simple for the base case. Supply the current SharePoint Framework context to the library. This works for both SharePoint authentication and Graph authentication using the current user. Graph permissions are controlled by the permissions granted to the SharePoint shared application within your tenant. +PnPjs is designed to work as easily as possible within the SharePoint Framework so the authentication setup is very simple for the base case. Supply the current SharePoint Framework context to the library. This works for both SharePoint authentication and Graph authentication using the current user. Graph permissions are controlled by the permissions granted to the SharePoint shared application within your tenant. The below example is taken from a SharePoint Framework webpart. @@ -50,7 +50,7 @@ protected async onInit(): Promise { ## MSAL Client -You might want/need to use a client configured to use your own AAD application and not the shared SharePoint application. You can do so using the [MSAL client](./msaljsclient.md). Here we show this using graph, this works the same with any of the [setup strategies](../getting-started.md). Please see the [MSAL library docs](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview) for more details on what values to supply in configuration. +You might want/need to use a client configured to use your own AAD application and not the shared SharePoint application. You can do so using the [MSAL client](./msaljsclient.md). Here we show this using graph, this works the same with any of the [setup strategies](../getting-started.md). Please see the [MSAL library docs](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview) for more details on what values to supply in the configuration. > Note: you must install the @pnp/msaljsclient client package before using it @@ -85,9 +85,9 @@ protected async onInit(): Promise { // ... ``` -## Adal Client +## ADAL Client -You can use the ADAL client from within SPFX, though it is recommened to transition to the MSAL client. +You can use the ADAL client from within SPFx, though it is recommended to transition to the MSAL client. > Note: you must install the @pnp/adaljsclient client package before using it diff --git a/docs/authentication/msaljsclient.md b/docs/authentication/msaljsclient.md index 982b21c5b..eabd31b61 100644 --- a/docs/authentication/msaljsclient.md +++ b/docs/authentication/msaljsclient.md @@ -10,7 +10,7 @@ You need to install the MSAL client before using it. This is in addition to inst ## Configure -The pnp client is a very thin wrapper around the MSAL library and you can supply any of the arguments supported. These are described in the [MSAL docs](https://azuread.github.io/microsoft-authentication-library-for-js/ref/msal-core/modules/_configuration_.html). +The PnP client is a very thin wrapper around the MSAL library and you can supply any of the arguments supported. These are described in the [MSAL docs](https://azuread.github.io/microsoft-authentication-library-for-js/ref/msal-core/modules/_configuration_.html). The basic configuration values you need (at least from our testing) are client id, authority, and redirectUri. The other options are settable but not required. This article is not intended to be an exhaustive discussion of all the MSAL configuration possibilities, please see the official docs to understand all of the available options. diff --git a/docs/authentication/server-nodejs.md b/docs/authentication/server-nodejs.md index 5e15c982e..27316cec6 100644 --- a/docs/authentication/server-nodejs.md +++ b/docs/authentication/server-nodejs.md @@ -25,7 +25,7 @@ const w = await sp.web.get(); ## MSAL -We do not currently have support for MSAL in node. At the time of writing this article the [@Azure/msal-node](https://www.npmjs.com/package/@azure/msal-node) package is in alpha and we have chosen to wait until it is more stable before taking that dependecy. +We do not currently have support for MSAL in node. At the time of writing this article the [@Azure/msal-node](https://www.npmjs.com/package/@azure/msal-node) package is in alpha and we have chosen to wait until it is more stable before taking on that dependency. ## ADAL diff --git a/docs/authentication/sp-app-registration.md b/docs/authentication/sp-app-registration.md index 95c2d0738..9c24fe2f8 100644 --- a/docs/authentication/sp-app-registration.md +++ b/docs/authentication/sp-app-registration.md @@ -9,9 +9,9 @@ Before you can begin running tests you need to register a low-trust add-in with 1. Navigation to {site url}/_layouts/appregnew.aspx 1. Click "Generate" for both the Client Id and Secret values 1. Give you add-in a title, this can be anything but will let you locate it in the list of add-in permissions -2. Provide a fake value for app domain and redirect uri -3. Click "Create" -4. Copy the returned block of text containing the client id and secret as well as app name for your records and later in this article. +1. Provide a fake value for app domain and redirect uri +1. Click "Create" +1. Copy the returned block of text containing the client id and secret as well as app name for your records and later in this article. ## Grant Your Add-In Permissions diff --git a/docs/common/collections.md b/docs/common/collections.md index d91681abf..de1971b0d 100644 --- a/docs/common/collections.md +++ b/docs/common/collections.md @@ -22,7 +22,7 @@ const map = objectToMap({ a: "b", c: "d"}); ## mergeMaps -Merges two or more maps, overwiting values with the same key. Last value in wins. +Merges two or more maps, overwriting values with the same key. Last value in wins. ```TypeScript const m1 = new Map(); diff --git a/docs/common/libconfig.md b/docs/common/libconfig.md index 9e0260993..ed394eb08 100644 --- a/docs/common/libconfig.md +++ b/docs/common/libconfig.md @@ -48,10 +48,7 @@ used to track the configuration values. The keys will match the values in the in ### assign -The assign method is used to add configuration to the global configuration instance. You can pass it any plain object with string keys and those values will be added. Any -existing values will be overwritten based on the keys. Last value in wins. For a more detailed scenario of using the RuntimeConfig instance in your own application please -see the section below "Using RuntimeConfig within your application". Note there are no methods to remove/clear the global config as it should be considered fairly static -as frequent updates may have unpredictable side effects as it is a global shared object. Generally it should be set at the start of your application. +The assign method is used to add configuration to the global configuration instance. You can pass it any plain object with string keys and those values will be added. Any existing values will be overwritten based on the keys. Last value in wins. For a more detailed scenario of using the RuntimeConfig instance in your own application please see the section below "Using RuntimeConfig within your application". Note there are no methods to remove/clear the global config as it should be considered fairly static as frequent updates may have unpredictable side effects as it is a global shared object. Generally it should be set at the start of your application. ```TypeScript import { RuntimeConfig } from "@pnp/common"; @@ -72,8 +69,7 @@ const v = RuntimeConfig.get("myKey1"); // "value 1" ## Using RuntimeConfig within your Application -If you have a set of properties you will access very frequently it may be desirable to implement your own configuration object and expose those values as properties. To -do so you will need to create an interface for your configuration (optional) and a wrapper class for RuntimeConfig to expose your properties +If you have a set of properties you will access very frequently it may be desirable to implement your own configuration object and expose those values as properties. To do so you will need to create an interface for your configuration (optional) and a wrapper class for RuntimeConfig to expose your properties ```TypeScript import { ILibraryConfiguration, RuntimeConfig, ITypedHash } from "@pnp/common"; diff --git a/docs/common/netutil.md b/docs/common/netutil.md index 2828bda4f..0803ccfbf 100644 --- a/docs/common/netutil.md +++ b/docs/common/netutil.md @@ -1,13 +1,13 @@ # @pnp/common/netutil -This module contains a set of classes and interfaces used to caracterize shared http interactions and configuration of the libraries. Some of the interfaces +This module contains a set of classes and interfaces used to characterize shared http interactions and configuration of the libraries. Some of the interfaces are described below (many have no use outside the library) as well as several classes. ## Interfaces ### HttpClientImpl -Defines an implementation of an Http Client within the context of @pnp. This being a class with a a single method "fetch" take a URL and options and returning a `Promise`. Used primarily with the shared request pipeline to define the client used to make the actual request. You can write your own [custom implementation](custom-httpclientimpl.md) if needed. +Defines an implementation of an Http Client within the context of @pnp. This being a class with a a single method "fetch" takes a URL and options. It returns a `Promise`. Used primarily with the shared request pipeline to define the client used to make the actual request. You can write your own [custom implementation](custom-httpclientimpl.md) if needed. ### RequestClient diff --git a/docs/common/util.md b/docs/common/util.md index 19eb9bb5f..23bfd0a36 100644 --- a/docs/common/util.md +++ b/docs/common/util.md @@ -7,10 +7,62 @@ import { getRandomString, } from "@pnp/common"; -// use from individual;y imported method +// use from individually imported method console.log(getRandomString(10)); ``` +## assign + +Merges a source object's own enumerable properties into a single target object. Similar to Object.assign, but allows control of overwriting of existing +properties. + +```TypeScript +import { assign } from "@pnp/common"; + +let obj1 = { + prop: 1, + prop2: 2, +}; + +const obj2 = { + prop: 4, + prop3: 9, +}; + +const example1 = assign(obj1, obj2); +// example1 = { prop: 4, prop2: 2, prop3: 9 } + +//noOverwrite = true stops overwriting existing properties +const example2 = assign(obj1, obj2, true); +// example2 = { prop: 1, prop2: 2, prop3: 9 } +``` + +## combine + +Combines any number of paths, normalizing the slashes as required + +```TypeScript +import { combine } from "@pnp/common"; + +// "https://microsoft.com/something/more" +const paths = combine("https://microsoft.com", "something", "more"); + +// "also/works/with/relative" +const paths2 = combine("/also/", "/works", "with/", "/relative\\"); +``` + +## dateAdd + +Manipulates a date, please see the [Stack Overflow discussion](https://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object) from where this method was taken. + +```TypeScript +import { dateAdd } from "@pnp/common"; + +const testDate = new Date(); + +dateAdd(testDate,'minute',10); +``` + ## getCtxCallback Gets a callback function which will maintain context across async calls. @@ -40,27 +92,19 @@ function theFunction2(g: number) { return this.myProp + g; } -const callback2 = getCtxCallback(contextThis, theFunction, 4); +const callback2 = getCtxCallback(contextThis, theFunction2, 4); callback2(); // returns 10 (6 + 4) ``` -## dateAdd - -Manipulates a date, please see the [Stack Overflow discussion](https://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object) from where this method was taken. - -## combine +## getGUID -Combines any number of paths, normalizing the slashes as required +Creates a random guid, please see the [Stack Overflow discussion](https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript) from where this method was taken. ```TypeScript -import { combine } from "@pnp/common"; - -// "https://microsoft.com/something/more" -const paths = combine("https://microsoft.com", "something", "more"); +import { getGUID } from "@pnp/common"; -// "also/works/with/relative" -const paths2 = combine("/also/", "/works", "with/", "/relative\\"); +const newGUID = getGUID(); ``` ## getRandomString @@ -73,54 +117,109 @@ import { getRandomString } from "@pnp/common"; const randomString = getRandomString(10); ``` -## getGUID +## hOP -Creates a random guid, please see the [Stack Overflow discussion](https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript) from where this method was taken. +Shortcut for Object.hasOwnProperty. Determines if an object has a specified property. -## isFunc +```TypeScript +import { HttpRequestError } from "@pnp/odata"; +import { hOP } from "@pnp/common"; -Determines if a supplied variable represents a function. +export async function handleError(e: Error | HttpRequestError): Promise { -## objectDefinedNotNull + //Checks to see if the error object has a property called isHttpRequestError. Returns a bool. + if (hOP(e, "isHttpRequestError")) { + // Handle this type or error + } else { + // not an HttpRequestError so we do something else -Determines if an object is defined and not null. + } +} +``` ## isArray Determines if a supplied variable represents an array. -## assign +```TypeScript +import { isArray } from "@pnp/common"; -Merges a source object's own enumerable properties into a single target object. Similar to Object.assign, but allows control of overwriting of existing -properties. +let x:String[] = [1,2,3]]; -```TypeScript -import { assign } from "@pnp/common"; +if (isArray(x)){ + console.log("I am an array"); +}else{ + console.log("I am not an array"); +} +``` -let obj1 = { - prop: 1, - prop2: 2, -}; +## isFunc -const obj2 = { - prop: 4, - prop3: 9, -}; +Determines if a supplied variable represents a function. -const example1 = assign(obj1, obj2); -// example1 = { prop: 4, prop2: 2, prop3: 9 } +```TypeScript +import { isFunc } from "@pnp/common"; -const example2 = assign(obj1, obj2, true); -// example2 = { prop: 1, prop2: 2, prop3: 9 } +public testFunction() { + console.log("test function"); + return +} + +if (isFunc(testFunction)){ + console.log("this is a function"); + testFunction(); +} ``` ## isUrlAbsolute Determines if a supplied url is absolute and returns true; otherwise returns false. +```TypeScript +import { isUrlAbsolute } from "@pnp/common"; + +const webPath = 'https://{tenant}.sharepoint.com/sites/dev/'; + +if (isUrlAbsolute(webPath)){ + console.log("URL is absolute"); +}else{ + console.log("URL is not absolute"); +} +``` + +## objectDefinedNotNull + +Determines if an object is defined and not null. + +```TypeScript +import { objectDefinedNotNull } from "@pnp/common"; + +let obj = { + prop: 1 +}; + +if (objectDefinedNotNull(obj)){ + console.log("Not null"); +}else{ + console.log("Null"); +} +``` + ## stringIsNullOrEmpty -Determines if a supplied string is null or empty +Determines if a supplied string is null or empty. + +```TypeScript +import { stringIsNullOrEmpty } from "@pnp/common"; + +let x:String = "hello"; + +if (stringIsNullOrEmpty(x)){ + console.log("Null or empty"); +}else{ + console.log("Not null or empty"); +} +``` ## Removed diff --git a/docs/concepts/custom-bundle.md b/docs/concepts/custom-bundle.md index faee83a65..c279437b4 100644 --- a/docs/concepts/custom-bundle.md +++ b/docs/concepts/custom-bundle.md @@ -5,8 +5,8 @@ With the introduction of [selective imports](./selective-imports.md) it is now p Scenarios could include: - Deploying a company-wide PnPjs custom bundle shared by all your components so it only needs to be downloaded once. -- Creating SPFx libraries either for one project or a single project -- Create a single library containing the PnPjs code you need bundled along with your customer [extensions](../odata/extensions.md). +- Creating SPFx libraries either for one project or a single webpart. +- Create a single library containing the PnPjs code you need bundled along with your custom [extensions](../odata/extensions.md). ## Create a custom bundle diff --git a/docs/concepts/error-handling.md b/docs/concepts/error-handling.md index de9706382..b67d17ad0 100644 --- a/docs/concepts/error-handling.md +++ b/docs/concepts/error-handling.md @@ -1,6 +1,6 @@ # Error Handling -This article describes the most common type of error generated by the library, provides context on the error object, and some ways to handle it. As always you should tailor your error handling to what your application needs. These are some idea that can be applied to many differnt patterns. +This article describes the most common types of errors generated by the library. It provides context on the error object, and ways to handle the errors. As always you should tailor your error handling to what your application needs. These are ideas that can be applied to many different patterns. > For 429, 503, and 504 errors we include retry logic within the library diff --git a/docs/concepts/ie11-mode.md b/docs/concepts/ie11-mode.md index b9773c313..d50760970 100644 --- a/docs/concepts/ie11-mode.md +++ b/docs/concepts/ie11-mode.md @@ -11,7 +11,7 @@ When required to use IE11 mode there is certain functionality which may not work ## Configure IE11 Mode -To enable IE11 Mode set the ie11 flag to true in the setup object. Optionally supply the context object when working in [SharePoint Framework](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview). +To enable IE11 Mode set the ie11 flag to true in the setup object. Optionally, supply the context object when working in [SharePoint Framework](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview). ```TypeScript import { sp } from "@pnp/sp"; diff --git a/docs/concepts/invokable.md b/docs/concepts/invokable.md index 48a45b800..7807643db 100644 --- a/docs/concepts/invokable.md +++ b/docs/concepts/invokable.md @@ -1,6 +1,6 @@ # Invokables -For folks who have been using the library since the early days you are familiar with the need to use the `.get()` method to invoke a method chain: +For people who have been using the library since the early days you are familiar with the need to use the `.get()` method to invoke a method chain: ```TypeScript // an example of get @@ -13,7 +13,7 @@ Starting with v2 this is no longer required, you can invoke the object directly const lists = await sp.web.lists(); ``` -This has two main benefits for folks using the library: you can write less code, and we now have a way to model default actions for objects that might do something other than a get. The way we designed the library prior to v2 hid the post, put, delete operations as protected methods attached to the Queryable classes. Without diving into a lot of why we did this having a rethink seemed appropriate for v2. Based on that the entire queryable chain is now invokable as well for any of the operations. +This has two main benefits for people using the library: you can write less code, and we now have a way to model default actions for objects that might do something other than a get. The way we designed the library prior to v2 hid the post, put, delete operations as protected methods attached to the Queryable classes. Without diving into why we did this, having a rethink seemed appropriate for v2. Based on that, the entire queryable chain is now invokable as well for any of the operations. ## Other Operations (post, put, delete) @@ -25,7 +25,7 @@ import "@pnp/sp/webs"; spPost(sp.web); ``` -But things get a little more interesting in that you can now do posts (or any of the operations) to any of the urls defined by a fluent chain. Meaning you can easily implement methods that are not yet part of the library. For this example I have made up a method called "MagicFieldCreationMethod" that doesn't exist. Imagine it was just added to the SharePoint API and we do not yet have support for it. You can now write code like so: +Things get a little more interesting in that you can now do posts (or any of the operations) to any of the urls defined by a fluent chain. Meaning you can easily implement methods that are not yet part of the library. For this example I have made up a method called "MagicFieldCreationMethod" that doesn't exist. Imagine it was just added to the SharePoint API and we do not yet have support for it. You can now write code like so: ```TypeScript import { sp, spPost, SharePointQueryable } from "@pnp/sp"; diff --git a/docs/concepts/polyfill.md b/docs/concepts/polyfill.md index 65856a5c9..e07442840 100644 --- a/docs/concepts/polyfill.md +++ b/docs/concepts/polyfill.md @@ -64,7 +64,7 @@ sp.search(builder).then(r => { ## General Statement on Polyfills -Internet Explorer 11 (IE11) has been an enterprise standard browser for many years. Given the complexity in changing technical platforms in many organizations, it is no surprise standardization on this out-of-date browser continues. Unfortunately, for those organizations the Internet has moved on and many - if not all - SaaS platforms are embracing modern standards and no longer supporting the legacy IE11 browser. Even Microsoft states in their official documentation that Microsoft 365 is best experienced with a modern browser. They have even gone so far to build the latest version of Microsoft Edge based on Chromium (Edge Chromium), with an "Internet Explorer mode" allowing organizations to load legacy sites which require IE automatically. +Internet Explorer 11 (IE11) has been an enterprise standard browser for many years. Given the complexity in changing technical platforms in many organizations, it is no surprise standardization on this out-of-date browser continues. Unfortunately, for those organizations, the Internet has moved on and many - if not all - SaaS platforms are embracing modern standards and no longer supporting the legacy IE11 browser. Even Microsoft states in their official documentation that Microsoft 365 is best experienced with a modern browser. They have even gone so far to build the latest version of Microsoft Edge based on Chromium (Edge Chromium), with an "Internet Explorer mode" allowing organizations to load legacy sites which require IE automatically. PnPjs is now "modern" as well, and by that we mean we have moved to using capabilities of current browsers and JavaScript which are not present in IE11. We understand as a developer your ability to require an organization to switch browsers is unrealistic. We want to do everything we can to support you, but it is up to you to ensure your application is properly supported in IE11. diff --git a/docs/concepts/selective-imports.md b/docs/concepts/selective-imports.md index 51558f7e5..5f6b48f10 100644 --- a/docs/concepts/selective-imports.md +++ b/docs/concepts/selective-imports.md @@ -103,7 +103,7 @@ const lists = await sp.web.lists(); The graph library contains a single preset, "all" mimicking the v1 structure. ```TypeScript -import { sp } from "@pnp/graph/presets/all"; +import { graph } from "@pnp/graph/presets/all"; // graph.* exists as it did in v1, tree shaking will not work ``` diff --git a/docs/concepts/settings.md b/docs/concepts/settings.md index f470b5b1d..f406f472f 100644 --- a/docs/concepts/settings.md +++ b/docs/concepts/settings.md @@ -30,7 +30,7 @@ module.exports = settings; ## Create Settings.js file -1. Copy the example file and rename it settings.js +1. Copy the example file and rename it settings.js. Place the file in the root of your project. 2. Update the settings as needed for your environment. > If you are only doing SharePoint testing you can leave the graph section off and vice-versa. Also, if you are not testing anything with hooks you can leave off the notificationUrl. diff --git a/docs/config-store/index.md b/docs/config-store/index.md index 10b762e38..2b75612e2 100644 --- a/docs/config-store/index.md +++ b/docs/config-store/index.md @@ -2,7 +2,7 @@ [![npm version](https://badge.fury.io/js/%40pnp%2Fconfig-store.svg)](https://badge.fury.io/js/%40pnp%2Fconfig-store) -This module providers a way to load application configuration from one or more providers and share it across an application in a consistent way. A provider can be anything - but we have included one to load information from a SharePoint list. This library is most helpful for larger applications where a formal configuration model is needed. +This module provides a way to load application configuration from one or more providers and share it across an application in a consistent way. A provider can be anything - but we have included one to load information from a SharePoint list. This library is most helpful for larger applications where a formal configuration model is needed. ## Getting Started diff --git a/docs/config-store/providers.md b/docs/config-store/providers.md index 70f985dee..0b3d8ff71 100644 --- a/docs/config-store/providers.md +++ b/docs/config-store/providers.md @@ -4,7 +4,7 @@ Currently there is a single provider included in the library, but contributions ## SPListConfigurationProvider -This provider is based on a SharePoint list and read all of the rows and makes them available as a `TypedHash`. By default the column names used are Title for key and "Value" for value, but you can update these as needed. Additionally the settings class supports the idea of last value in wins - so you can easily load multiple configurations. This helps to support a common scenario in the enterprise where you might have one main list for global configuration but some settings can be set at the web level. In this case you would first load the global, then the local settings and any local values will take precedence. +This provider is based on a SharePoint list it reads all of the rows and makes them available as a `TypedHash`. By default the column names used are Title for key and "Value" for value, but you can update these as needed. Additionally, the settings class supports the idea of last value in wins - so you can easily load multiple configurations. This helps to support a common scenario in the enterprise where you might have one main list for global configuration but some settings can be set at the web level. In this case you would first load the global, then the local settings and any local values will take precedence. ```TypeScript import { Web } from "@pnp/sp/presets/all";