UNPKG

@pnp/pnpjs

Version:

pnp - rollup library of all functionality

95 lines 2.66 kB
import { Logger } from "@pnp/logging"; import { PnPClientStorage, dateAdd, combine, getCtxCallback, getRandomString, getGUID, isFunc, objectDefinedNotNull, isArray, assign, isUrlAbsolute, stringIsNullOrEmpty, sanitizeGuid, } from "@pnp/common"; import { Settings } from "@pnp/config-store"; import { sp as _sp } from "@pnp/sp-addinhelpers"; import { setup as _setup } from "./pnplibconfig.js"; import { graph as _graph } from "@pnp/graph"; // trigger attachment of all functionality to mimic the previous pnpjs impl import "@pnp/sp/presets/all"; import "@pnp/graph/presets/all"; /** * Re-export everything from the dependencies to match the previous pattern */ export * from "@pnp/common"; export * from "@pnp/logging"; export * from "@pnp/config-store"; export * from "@pnp/odata"; export * from "./sp-ns.js"; export * from "./graph-ns.js"; /** * Utility methods */ export var util = { assign: assign, combine: combine, dateAdd: dateAdd, getCtxCallback: getCtxCallback, getGUID: getGUID, getRandomString: getRandomString, isArray: isArray, isFunc: isFunc, isUrlAbsolute: isUrlAbsolute, objectDefinedNotNull: objectDefinedNotNull, sanitizeGuid: sanitizeGuid, stringIsNullOrEmpty: stringIsNullOrEmpty, }; /** * Provides access to the SharePoint REST interface */ export var sp = _sp; /** * Provides access to the SharePoint REST interface */ export var graph = _graph; /** * Provides access to local and session storage */ export var storage = new PnPClientStorage(); /** * Global configuration instance to which providers can be added */ export var config = new Settings(); /** * Global logging instance to which subscribers can be registered and messages written */ export var log = Logger; /** * Allows for the configuration of the library */ export var setup = _setup; // creating this class instead of directly assigning to default fixes a previous issue var Def = { /** * Global configuration instance to which providers can be added */ config: config, /** * Provides access to the Graph REST interface */ graph: graph, /** * Global logging instance to which subscribers can be registered and messages written */ log: log, /** * Provides access global setup method */ setup: setup, /** * Provides access to the SharePoint REST interface */ sp: sp, /** * Provides access to local and session storage */ storage: storage, /** * Utility methods */ util: util, }; /** * Enables use of the import pnp from syntax */ export default Def; //# sourceMappingURL=index.js.map