Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pnp/config-store

Package Overview
Dependencies
Maintainers
6
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnp/config-store - npm Package Compare versions

Comparing version 1.0.0-beta.2 to 1.0.0-beta.3

dist/config-store.es5.umd.bundle.js

13

dist/config-store.es5.js
import { Dictionary, PnPClientStorage } from '@pnp/common';
import { __extends } from 'tslib';
import { LogLevel, Logger } from '@pnp/logging';

@@ -93,12 +94,2 @@

var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var NoCacheAvailableException = /** @class */ (function (_super) {

@@ -249,3 +240,3 @@ __extends(NoCacheAvailableException, _super);

export { Settings, CachingConfigurationProvider, SPListConfigurationProvider };
export { Settings, CachingConfigurationProvider, SPListConfigurationProvider, NoCacheAvailableException };
//# sourceMappingURL=config-store.es5.js.map
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@pnp/common'), require('@pnp/logging')) :
typeof define === 'function' && define.amd ? define(['exports', '@pnp/common', '@pnp/logging'], factory) :
(factory((global.pnp = {}),global.common,global.logging));
}(this, (function (exports,common,logging) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@pnp/common'), require('tslib'), require('@pnp/logging')) :
typeof define === 'function' && define.amd ? define(['exports', '@pnp/common', 'tslib', '@pnp/logging'], factory) :
(factory((global.pnp = global.pnp || {}, global.pnp['config-store'] = {}),global.common,global.tslib_1,global.logging));
}(this, (function (exports,common,tslib_1,logging) { 'use strict';

@@ -96,14 +96,4 @@ /**

var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var NoCacheAvailableException = /** @class */ (function (_super) {
__extends(NoCacheAvailableException, _super);
tslib_1.__extends(NoCacheAvailableException, _super);
function NoCacheAvailableException(msg) {

@@ -255,2 +245,3 @@ if (msg === void 0) { msg = "Cannot create a caching configuration provider since cache is not available."; }

exports.SPListConfigurationProvider = SPListConfigurationProvider;
exports.NoCacheAvailableException = NoCacheAvailableException;

@@ -257,0 +248,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@pnp/common"),require("@pnp/logging")):"function"==typeof define&&define.amd?define(["exports","@pnp/common","@pnp/logging"],e):e(t.pnp={},t.common,t.logging)}(this,function(t,e,n){"use strict";var o=function(){function t(){this._settings=new e.Dictionary}return t.prototype.add=function(t,e){this._settings.add(t,e)},t.prototype.addJSON=function(t,e){this._settings.add(t,JSON.stringify(e))},t.prototype.apply=function(t){var e=this;return new Promise(function(n,o){try{e._settings.merge(t),n()}catch(t){o(t)}})},t.prototype.load=function(t){var e=this;return new Promise(function(n,o){t.getConfiguration().then(function(t){e._settings.merge(t),n()}).catch(function(t){o(t)})})},t.prototype.get=function(t){return this._settings.get(t)},t.prototype.getJSON=function(t){var e=this.get(t);return void 0===e||null===e?e:JSON.parse(e)},t}(),i=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),r=function(t){function e(e){void 0===e&&(e="Cannot create a caching configuration provider since cache is not available.");var o=t.call(this,e)||this;return o.name="NoCacheAvailableException",n.Logger.log({data:{},level:n.LogLevel.Error,message:"["+o.name+"]::"+o.message}),o}return i(e,t),e}(Error),s=function(){function t(t,e,n){this.wrappedProvider=t,this.store=n||this.selectPnPCache(),this.cacheKey="_configcache_"+e}return t.prototype.getWrappedProvider=function(){return this.wrappedProvider},t.prototype.getConfiguration=function(){var t=this;if(!this.store||!this.store.enabled)return this.wrappedProvider.getConfiguration();var e=this.store.get(this.cacheKey);if(e)return new Promise(function(t){t(e)});var n=this.wrappedProvider.getConfiguration();return n.then(function(e){t.store.put(t.cacheKey,e)}),n},t.prototype.selectPnPCache=function(){var t=new e.PnPClientStorage;if(t.local&&t.local.enabled)return t.local;if(t.session&&t.session.enabled)return t.session;throw new r},t}(),c=function(){function t(t,e){void 0===e&&(e="config"),this.sourceWeb=t,this.sourceListTitle=e}return Object.defineProperty(t.prototype,"web",{get:function(){return this.sourceWeb},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listTitle",{get:function(){return this.sourceListTitle},enumerable:!0,configurable:!0}),t.prototype.getConfiguration=function(){return this.web.lists.getByTitle(this.listTitle).items.select("Title","Value").getAs().then(function(t){return t.reduce(function(t,e){return Object.defineProperty(t,e.Title,{configurable:!1,enumerable:!1,value:e.Value,writable:!1})},{})})},t.prototype.asCaching=function(){var t="splist_"+this.web.toUrl()+"+"+this.listTitle;return new s(this,t)},t}();t.Settings=o,t.CachingConfigurationProvider=s,t.SPListConfigurationProvider=c,Object.defineProperty(t,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@pnp/common"),require("tslib"),require("@pnp/logging")):"function"==typeof define&&define.amd?define(["exports","@pnp/common","tslib","@pnp/logging"],t):t((e.pnp=e.pnp||{},e.pnp["config-store"]={}),e.common,e.tslib_1,e.logging)}(this,function(e,t,n,i){"use strict";var r=function(){function e(){this._settings=new t.Dictionary}return e.prototype.add=function(e,t){this._settings.add(e,t)},e.prototype.addJSON=function(e,t){this._settings.add(e,JSON.stringify(t))},e.prototype.apply=function(e){var t=this;return new Promise(function(n,i){try{t._settings.merge(e),n()}catch(e){i(e)}})},e.prototype.load=function(e){var t=this;return new Promise(function(n,i){e.getConfiguration().then(function(e){t._settings.merge(e),n()}).catch(function(e){i(e)})})},e.prototype.get=function(e){return this._settings.get(e)},e.prototype.getJSON=function(e){var t=this.get(e);return void 0===t||null===t?t:JSON.parse(t)},e}(),o=function(e){function t(t){void 0===t&&(t="Cannot create a caching configuration provider since cache is not available.");var n=e.call(this,t)||this;return n.name="NoCacheAvailableException",i.Logger.log({data:{},level:i.LogLevel.Error,message:"["+n.name+"]::"+n.message}),n}return n.__extends(t,e),t}(Error),s=function(){function e(e,t,n){this.wrappedProvider=e,this.store=n||this.selectPnPCache(),this.cacheKey="_configcache_"+t}return e.prototype.getWrappedProvider=function(){return this.wrappedProvider},e.prototype.getConfiguration=function(){var e=this;if(!this.store||!this.store.enabled)return this.wrappedProvider.getConfiguration();var t=this.store.get(this.cacheKey);if(t)return new Promise(function(e){e(t)});var n=this.wrappedProvider.getConfiguration();return n.then(function(t){e.store.put(e.cacheKey,t)}),n},e.prototype.selectPnPCache=function(){var e=new t.PnPClientStorage;if(e.local&&e.local.enabled)return e.local;if(e.session&&e.session.enabled)return e.session;throw new o},e}(),c=function(){function e(e,t){void 0===t&&(t="config"),this.sourceWeb=e,this.sourceListTitle=t}return Object.defineProperty(e.prototype,"web",{get:function(){return this.sourceWeb},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listTitle",{get:function(){return this.sourceListTitle},enumerable:!0,configurable:!0}),e.prototype.getConfiguration=function(){return this.web.lists.getByTitle(this.listTitle).items.select("Title","Value").getAs().then(function(e){return e.reduce(function(e,t){return Object.defineProperty(e,t.Title,{configurable:!1,enumerable:!1,value:t.Value,writable:!1})},{})})},e.prototype.asCaching=function(){var e="splist_"+this.web.toUrl()+"+"+this.listTitle;return new s(this,e)},e}();e.Settings=r,e.CachingConfigurationProvider=s,e.SPListConfigurationProvider=c,e.NoCacheAvailableException=o,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -219,3 +219,3 @@ import { Dictionary, PnPClientStorage } from '@pnp/common';

export { Settings, CachingConfigurationProvider, SPListConfigurationProvider };
export { Settings, CachingConfigurationProvider, SPListConfigurationProvider, NoCacheAvailableException };
//# sourceMappingURL=config-store.js.map
{
"name": "@pnp/config-store",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"description": "pnp - provides a way to manage configuration within your application",
"main": "./dist/config-store.es5.umd.js",
"typings": "./index",
"dependencies": {},
"dependencies": {
"tslib": "1.7.1"
},
"peerDependencies": {
"@pnp/common": "1.0.0-beta.2",
"@pnp/sp": "1.0.0-beta.2",
"@pnp/logging": "1.0.0-beta.2"
"@pnp/common": "1.0.0-beta.3",
"@pnp/sp": "1.0.0-beta.3",
"@pnp/logging": "1.0.0-beta.3"
},

@@ -13,0 +15,0 @@ "author": {

export * from "./configuration";
export * from "./providers/index";
export * from "./exceptions";

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc