@pnp/nodejs 3.0.0-v3nightly.20210905 → 3.0.0-v3nightly.20210906

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,25 +1,25 @@
1
- SharePoint Patterns and Practices (PnP)
2
-
3
- The MIT License (MIT)
4
-
5
- Copyright (c) Microsoft Corporation
6
-
7
- All rights reserved.
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy
10
- of this software and associated documentation files (the "Software"), to deal
11
- in the Software without restriction, including without limitation the rights
12
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- copies of the Software, and to permit persons to whom the Software is
14
- furnished to do so, subject to the following conditions:
15
-
16
- The above copyright notice and this permission notice shall be included in all
17
- copies or substantial portions of the Software.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- SOFTWARE.
1
+ SharePoint Patterns and Practices (PnP)
2
+
3
+ The MIT License (MIT)
4
+
5
+ Copyright (c) Microsoft Corporation
6
+
7
+ All rights reserved.
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
@@ -1,4 +1,4 @@
1
- import { TimelinePipe } from "@pnp/core";
2
- import { Queryable } from "@pnp/queryable";
3
- export declare function Agent(agent: any): TimelinePipe<Queryable>;
1
+ import { TimelinePipe } from "@pnp/core";
2
+ import { Queryable } from "@pnp/queryable";
3
+ export declare function Agent(agent: any): TimelinePipe<Queryable>;
4
4
  //# sourceMappingURL=agent.d.ts.map
@@ -1,11 +1,11 @@
1
- export function Agent(agent) {
2
- return (instance) => {
3
- instance.on.pre(async (url, init, result) => {
4
- // we add the proxy to the request
5
- init.agent = agent;
6
- return [url, init, result];
7
- });
8
- return instance;
9
- };
10
- }
1
+ export function Agent(agent) {
2
+ return (instance) => {
3
+ instance.on.pre(async (url, init, result) => {
4
+ // we add the proxy to the request
5
+ init.agent = agent;
6
+ return [url, init, result];
7
+ });
8
+ return instance;
9
+ };
10
+ }
11
11
  //# sourceMappingURL=agent.js.map
@@ -1,5 +1,5 @@
1
- import { Queryable } from "@pnp/queryable";
2
- import { TimelinePipe } from "@pnp/core";
3
- export declare function NodeFetch(): TimelinePipe<Queryable>;
4
- export declare function NodeFetchWithRetry(retries?: number, interval?: number): TimelinePipe<Queryable>;
1
+ import { Queryable } from "@pnp/queryable";
2
+ import { TimelinePipe } from "@pnp/core";
3
+ export declare function NodeFetch(): TimelinePipe<Queryable>;
4
+ export declare function NodeFetchWithRetry(retries?: number, interval?: number): TimelinePipe<Queryable>;
5
5
  //# sourceMappingURL=fetch.d.ts.map
@@ -1,66 +1,66 @@
1
- import { HttpRequestError } from "@pnp/queryable";
2
- import { default as nodeFetch } from "node-fetch";
3
- import { delay } from "@pnp/core";
4
- export function NodeFetch() {
5
- return (instance) => {
6
- instance.on.send.replace(function (url, init) {
7
- this.emit.log(`Fetch: ${init.method} ${url.toString()}`, 0 /* Verbose */);
8
- return nodeFetch(url.toString(), init);
9
- });
10
- return instance;
11
- };
12
- }
13
- export function NodeFetchWithRetry(retries = 3, interval = 200) {
14
- return (instance) => {
15
- instance.on.send.replace(function (url, init) {
16
- let response;
17
- let wait = interval;
18
- let count = 1;
19
- const retry = async () => {
20
- // if we've tried too many times, throw
21
- if (count >= retries) {
22
- throw new HttpRequestError(`Retry count exceeded (${retries}) for this request. ${response.status}: ${response.statusText};`, response);
23
- }
24
- if (typeof response === "undefined" || response?.status === 429 || response?.status === 503 || response?.status === 504) {
25
- // this is our first try and response isn't defined yet
26
- // we have been throttled OR http status code 503 or 504, we can retry this
27
- if (typeof response !== "undefined") {
28
- // this isn't our first try so we need to calculate delay
29
- if (response.headers.has("Retry-After")) {
30
- // if we have gotten a header, use that value as the delay value in seconds
31
- wait = parseInt(response.headers.get("Retry-After"), 10) * 1000;
32
- }
33
- else {
34
- // Increment our counters.
35
- wait *= 2;
36
- }
37
- this.emit.log(`Attempt #${count} to retry request which failed with ${response.status}: ${response.statusText}`, 0 /* Verbose */);
38
- count++;
39
- await delay(wait);
40
- }
41
- try {
42
- this.emit.log(`Fetch: ${init.method} ${url.toString()}`, 0 /* Verbose */);
43
- response = await nodeFetch(url.toString(), init);
44
- // if we got a good response, return it, otherwise see if we can retry
45
- return response.ok ? response : retry();
46
- }
47
- catch (err) {
48
- if (err && err.code && ["ETIMEDOUT", "ESOCKETTIMEDOUT", "ECONNREFUSED", "ECONNRESET"].indexOf(err.code.toUpperCase()) < 0) {
49
- // this is some non-transient node error, no retry
50
- throw err;
51
- }
52
- return retry();
53
- }
54
- }
55
- else {
56
- return response;
57
- }
58
- };
59
- // this the the first call to retry that starts the cycle
60
- // response is undefined and the other values have their defaults
61
- return retry();
62
- });
63
- return instance;
64
- };
65
- }
1
+ import { HttpRequestError } from "@pnp/queryable";
2
+ import { default as nodeFetch } from "node-fetch";
3
+ import { delay } from "@pnp/core";
4
+ export function NodeFetch() {
5
+ return (instance) => {
6
+ instance.on.send.replace(function (url, init) {
7
+ this.emit.log(`Fetch: ${init.method} ${url.toString()}`, 0 /* Verbose */);
8
+ return nodeFetch(url.toString(), init);
9
+ });
10
+ return instance;
11
+ };
12
+ }
13
+ export function NodeFetchWithRetry(retries = 3, interval = 200) {
14
+ return (instance) => {
15
+ instance.on.send.replace(function (url, init) {
16
+ let response;
17
+ let wait = interval;
18
+ let count = 1;
19
+ const retry = async () => {
20
+ // if we've tried too many times, throw
21
+ if (count >= retries) {
22
+ throw new HttpRequestError(`Retry count exceeded (${retries}) for this request. ${response.status}: ${response.statusText};`, response);
23
+ }
24
+ if (typeof response === "undefined" || response?.status === 429 || response?.status === 503 || response?.status === 504) {
25
+ // this is our first try and response isn't defined yet
26
+ // we have been throttled OR http status code 503 or 504, we can retry this
27
+ if (typeof response !== "undefined") {
28
+ // this isn't our first try so we need to calculate delay
29
+ if (response.headers.has("Retry-After")) {
30
+ // if we have gotten a header, use that value as the delay value in seconds
31
+ wait = parseInt(response.headers.get("Retry-After"), 10) * 1000;
32
+ }
33
+ else {
34
+ // Increment our counters.
35
+ wait *= 2;
36
+ }
37
+ this.emit.log(`Attempt #${count} to retry request which failed with ${response.status}: ${response.statusText}`, 0 /* Verbose */);
38
+ count++;
39
+ await delay(wait);
40
+ }
41
+ try {
42
+ this.emit.log(`Fetch: ${init.method} ${url.toString()}`, 0 /* Verbose */);
43
+ response = await nodeFetch(url.toString(), init);
44
+ // if we got a good response, return it, otherwise see if we can retry
45
+ return response.ok ? response : retry();
46
+ }
47
+ catch (err) {
48
+ if (err && err.code && ["ETIMEDOUT", "ESOCKETTIMEDOUT", "ECONNREFUSED", "ECONNRESET"].indexOf(err.code.toUpperCase()) < 0) {
49
+ // this is some non-transient node error, no retry
50
+ throw err;
51
+ }
52
+ return retry();
53
+ }
54
+ }
55
+ else {
56
+ return response;
57
+ }
58
+ };
59
+ // this the the first call to retry that starts the cycle
60
+ // response is undefined and the other values have their defaults
61
+ return retry();
62
+ });
63
+ return instance;
64
+ };
65
+ }
66
66
  //# sourceMappingURL=fetch.js.map
@@ -1,12 +1,12 @@
1
- import { Configuration } from "@azure/msal-node";
2
- import { TimelinePipe } from "@pnp/core";
3
- import { Queryable } from "@pnp/queryable";
4
- export interface IGraphDefaultProps {
5
- baseUrl?: string;
6
- msal: {
7
- config: Configuration;
8
- scopes?: string[];
9
- };
10
- }
11
- export declare function GraphDefault(props: IGraphDefaultProps): TimelinePipe<Queryable>;
1
+ import { Configuration } from "@azure/msal-node";
2
+ import { TimelinePipe } from "@pnp/core";
3
+ import { Queryable } from "@pnp/queryable";
4
+ export interface IGraphDefaultProps {
5
+ baseUrl?: string;
6
+ msal: {
7
+ config: Configuration;
8
+ scopes?: string[];
9
+ };
10
+ }
11
+ export declare function GraphDefault(props: IGraphDefaultProps): TimelinePipe<Queryable>;
12
12
  //# sourceMappingURL=graphdefault.d.ts.map
@@ -1,31 +1,31 @@
1
- import { combine, isUrlAbsolute } from "@pnp/core";
2
- import { DefaultParse } from "@pnp/queryable";
3
- import { DefaultHeaders, DefaultInit } from "@pnp/graph";
4
- import { NodeFetchWithRetry } from "./fetch.js";
5
- import { MSAL } from "./msal.js";
6
- export function GraphDefault(props) {
7
- if (props.baseUrl && !isUrlAbsolute(props.baseUrl)) {
8
- throw Error("GraphDefault props.baseUrl must be absolute when supplied.");
9
- }
10
- return (instance) => {
11
- instance
12
- .using(MSAL(props.msal.config, props?.msal?.scopes || ["https://graph.microsoft.com/.default"]))
13
- .using(NodeFetchWithRetry())
14
- .using(DefaultParse())
15
- .using(DefaultHeaders())
16
- .using(DefaultInit());
17
- instance.on.pre(async (url, init, result) => {
18
- if (!isUrlAbsolute(url)) {
19
- if (isUrlAbsolute(props.baseUrl)) {
20
- url = combine(props.baseUrl, url);
21
- }
22
- else {
23
- url = combine("https://graph.microsoft.com/", url);
24
- }
25
- }
26
- return [url, init, result];
27
- });
28
- return instance;
29
- };
30
- }
1
+ import { combine, isUrlAbsolute } from "@pnp/core";
2
+ import { DefaultParse } from "@pnp/queryable";
3
+ import { DefaultHeaders, DefaultInit } from "@pnp/graph";
4
+ import { NodeFetchWithRetry } from "./fetch.js";
5
+ import { MSAL } from "./msal.js";
6
+ export function GraphDefault(props) {
7
+ if (props.baseUrl && !isUrlAbsolute(props.baseUrl)) {
8
+ throw Error("GraphDefault props.baseUrl must be absolute when supplied.");
9
+ }
10
+ return (instance) => {
11
+ instance
12
+ .using(MSAL(props.msal.config, props?.msal?.scopes || ["https://graph.microsoft.com/.default"]))
13
+ .using(NodeFetchWithRetry())
14
+ .using(DefaultParse())
15
+ .using(DefaultHeaders())
16
+ .using(DefaultInit());
17
+ instance.on.pre(async (url, init, result) => {
18
+ if (!isUrlAbsolute(url)) {
19
+ if (isUrlAbsolute(props.baseUrl)) {
20
+ url = combine(props.baseUrl, url);
21
+ }
22
+ else {
23
+ url = combine("https://graph.microsoft.com/", url);
24
+ }
25
+ }
26
+ return [url, init, result];
27
+ });
28
+ return instance;
29
+ };
30
+ }
31
31
  //# sourceMappingURL=graphdefault.js.map
@@ -1,5 +1,5 @@
1
- import { Configuration } from "@azure/msal-node";
2
- import { TimelinePipe } from "@pnp/core";
3
- import { Queryable } from "@pnp/queryable";
4
- export declare function MSAL(config: Configuration, scopes?: string[]): TimelinePipe<Queryable>;
1
+ import { Configuration } from "@azure/msal-node";
2
+ import { TimelinePipe } from "@pnp/core";
3
+ import { Queryable } from "@pnp/queryable";
4
+ export declare function MSAL(config: Configuration, scopes?: string[]): TimelinePipe<Queryable>;
5
5
  //# sourceMappingURL=msal.d.ts.map
package/behaviors/msal.js CHANGED
@@ -1,14 +1,14 @@
1
- import { ConfidentialClientApplication } from "@azure/msal-node";
2
- export function MSAL(config, scopes = ["https://graph.microsoft.com/.default"]) {
3
- const confidentialClient = new ConfidentialClientApplication(config);
4
- return (instance) => {
5
- instance.on.auth(async (url, init) => {
6
- const token = await confidentialClient.acquireTokenByClientCredential({ scopes });
7
- // eslint-disable-next-line @typescript-eslint/dot-notation
8
- init.headers["Authorization"] = `${token.tokenType} ${token.accessToken}`;
9
- return [url, init];
10
- });
11
- return instance;
12
- };
13
- }
1
+ import { ConfidentialClientApplication } from "@azure/msal-node";
2
+ export function MSAL(config, scopes = ["https://graph.microsoft.com/.default"]) {
3
+ const confidentialClient = new ConfidentialClientApplication(config);
4
+ return (instance) => {
5
+ instance.on.auth(async (url, init) => {
6
+ const token = await confidentialClient.acquireTokenByClientCredential({ scopes });
7
+ // eslint-disable-next-line @typescript-eslint/dot-notation
8
+ init.headers["Authorization"] = `${token.tokenType} ${token.accessToken}`;
9
+ return [url, init];
10
+ });
11
+ return instance;
12
+ };
13
+ }
14
14
  //# sourceMappingURL=msal.js.map
@@ -1,5 +1,5 @@
1
- import { TimelinePipe } from "@pnp/core";
2
- import { Queryable } from "@pnp/queryable";
3
- export declare function Proxy(proxyInit: string): TimelinePipe<Queryable>;
4
- export declare function Proxy(proxyInit: any): TimelinePipe<Queryable>;
1
+ import { TimelinePipe } from "@pnp/core";
2
+ import { Queryable } from "@pnp/queryable";
3
+ export declare function Proxy(proxyInit: string): TimelinePipe<Queryable>;
4
+ export declare function Proxy(proxyInit: any): TimelinePipe<Queryable>;
5
5
  //# sourceMappingURL=proxy.d.ts.map
@@ -1,14 +1,14 @@
1
- import { HttpsProxyAgent } from "https-proxy-agent";
2
- // eslint-disable-next-line no-redeclare
3
- export function Proxy(proxyInit) {
4
- const proxy = typeof proxyInit === "string" ? new HttpsProxyAgent(proxyInit) : proxyInit;
5
- return (instance) => {
6
- instance.on.pre(async (url, init, result) => {
7
- // we add the proxy to the request
8
- init.agent = proxy;
9
- return [url, init, result];
10
- });
11
- return instance;
12
- };
13
- }
1
+ import { HttpsProxyAgent } from "https-proxy-agent";
2
+ // eslint-disable-next-line no-redeclare
3
+ export function Proxy(proxyInit) {
4
+ const proxy = typeof proxyInit === "string" ? new HttpsProxyAgent(proxyInit) : proxyInit;
5
+ return (instance) => {
6
+ instance.on.pre(async (url, init, result) => {
7
+ // we add the proxy to the request
8
+ init.agent = proxy;
9
+ return [url, init, result];
10
+ });
11
+ return instance;
12
+ };
13
+ }
14
14
  //# sourceMappingURL=proxy.js.map
@@ -1,12 +1,12 @@
1
- import { Configuration } from "@azure/msal-node";
2
- import { TimelinePipe } from "@pnp/core";
3
- import { Queryable } from "@pnp/queryable";
4
- export interface ISPDefaultProps {
5
- baseUrl?: string;
6
- msal: {
7
- config: Configuration;
8
- scopes: string[];
9
- };
10
- }
11
- export declare function SPDefault(props: ISPDefaultProps): TimelinePipe<Queryable>;
1
+ import { Configuration } from "@azure/msal-node";
2
+ import { TimelinePipe } from "@pnp/core";
3
+ import { Queryable } from "@pnp/queryable";
4
+ export interface ISPDefaultProps {
5
+ baseUrl?: string;
6
+ msal: {
7
+ config: Configuration;
8
+ scopes: string[];
9
+ };
10
+ }
11
+ export declare function SPDefault(props: ISPDefaultProps): TimelinePipe<Queryable>;
12
12
  //# sourceMappingURL=spdefault.d.ts.map
@@ -1,21 +1,21 @@
1
- import { combine, isUrlAbsolute } from "@pnp/core";
2
- import { DefaultParse } from "@pnp/queryable";
3
- import { DefaultHeaders, DefaultInit } from "@pnp/sp";
4
- import { NodeFetchWithRetry } from "./fetch.js";
5
- import { MSAL } from "./msal.js";
6
- export function SPDefault(props) {
7
- if (props.baseUrl && !isUrlAbsolute(props.baseUrl)) {
8
- throw Error("SPDefault props.baseUrl must be absolute when supplied.");
9
- }
10
- return (instance) => {
11
- instance.using(MSAL(props.msal.config, props.msal.scopes), DefaultHeaders(), DefaultInit(), NodeFetchWithRetry(), DefaultParse());
12
- instance.on.pre(async (url, init, result) => {
13
- if (!isUrlAbsolute(url) && isUrlAbsolute(props.baseUrl)) {
14
- url = combine(props.baseUrl, url);
15
- }
16
- return [url, init, result];
17
- });
18
- return instance;
19
- };
20
- }
1
+ import { combine, isUrlAbsolute } from "@pnp/core";
2
+ import { DefaultParse } from "@pnp/queryable";
3
+ import { DefaultHeaders, DefaultInit } from "@pnp/sp";
4
+ import { NodeFetchWithRetry } from "./fetch.js";
5
+ import { MSAL } from "./msal.js";
6
+ export function SPDefault(props) {
7
+ if (props.baseUrl && !isUrlAbsolute(props.baseUrl)) {
8
+ throw Error("SPDefault props.baseUrl must be absolute when supplied.");
9
+ }
10
+ return (instance) => {
11
+ instance.using(MSAL(props.msal.config, props.msal.scopes), DefaultHeaders(), DefaultInit(), NodeFetchWithRetry(), DefaultParse());
12
+ instance.on.pre(async (url, init, result) => {
13
+ if (!isUrlAbsolute(url) && isUrlAbsolute(props.baseUrl)) {
14
+ url = combine(props.baseUrl, url);
15
+ }
16
+ return [url, init, result];
17
+ });
18
+ return instance;
19
+ };
20
+ }
21
21
  //# sourceMappingURL=spdefault.js.map
@@ -1,4 +1,4 @@
1
- import { TimelinePipe } from "@pnp/core";
2
- import { Queryable } from "@pnp/queryable";
3
- export declare function StreamParse(): TimelinePipe<Queryable>;
1
+ import { TimelinePipe } from "@pnp/core";
2
+ import { Queryable } from "@pnp/queryable";
3
+ export declare function StreamParse(): TimelinePipe<Queryable>;
4
4
  //# sourceMappingURL=stream-parse.d.ts.map
@@ -1,5 +1,5 @@
1
- import { parseBinderWithErrorCheck } from "@pnp/queryable";
2
- export function StreamParse() {
3
- return parseBinderWithErrorCheck(async (r) => ({ body: r.body, knownLength: parseInt(r.headers.get("content-length"), 10) }));
4
- }
1
+ import { parseBinderWithErrorCheck } from "@pnp/queryable";
2
+ export function StreamParse() {
3
+ return parseBinderWithErrorCheck(async (r) => ({ body: r.body, knownLength: parseInt(r.headers.get("content-length"), 10) }));
4
+ }
5
5
  //# sourceMappingURL=stream-parse.js.map
package/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import "./sp-extensions/index.js";
2
- import * as SPNS from "./sp-extensions/index.js";
3
- export { SPNS, };
4
- export * from "./behaviors/msal.js";
5
- export * from "./behaviors/fetch.js";
6
- export * from "./behaviors/proxy.js";
7
- export * from "./behaviors/agent.js";
8
- export * from "./behaviors/stream-parse.js";
9
- export * from "./behaviors/spdefault.js";
10
- export * from "./behaviors/graphdefault.js";
1
+ import "./sp-extensions/index.js";
2
+ import * as SPNS from "./sp-extensions/index.js";
3
+ export { SPNS, };
4
+ export * from "./behaviors/msal.js";
5
+ export * from "./behaviors/fetch.js";
6
+ export * from "./behaviors/proxy.js";
7
+ export * from "./behaviors/agent.js";
8
+ export * from "./behaviors/stream-parse.js";
9
+ export * from "./behaviors/spdefault.js";
10
+ export * from "./behaviors/graphdefault.js";
11
11
  //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -1,26 +1,26 @@
1
- import * as NodeFetch from "node-fetch";
2
- (function (g) {
3
- // patch these globally for nodejs
4
- if (!g.Headers) {
5
- g.Headers = NodeFetch.Headers;
6
- }
7
- if (!g.Request) {
8
- g.Request = NodeFetch.Request;
9
- }
10
- if (!g.Response) {
11
- g.Response = NodeFetch.Response;
12
- }
13
- })(global);
14
- // auto populate all extensions
15
- import "./sp-extensions/index.js";
16
- // export extension types as a namespace
17
- import * as SPNS from "./sp-extensions/index.js";
18
- export { SPNS, };
19
- export * from "./behaviors/msal.js";
20
- export * from "./behaviors/fetch.js";
21
- export * from "./behaviors/proxy.js";
22
- export * from "./behaviors/agent.js";
23
- export * from "./behaviors/stream-parse.js";
24
- export * from "./behaviors/spdefault.js";
25
- export * from "./behaviors/graphdefault.js";
1
+ import * as NodeFetch from "node-fetch";
2
+ (function (g) {
3
+ // patch these globally for nodejs
4
+ if (!g.Headers) {
5
+ g.Headers = NodeFetch.Headers;
6
+ }
7
+ if (!g.Request) {
8
+ g.Request = NodeFetch.Request;
9
+ }
10
+ if (!g.Response) {
11
+ g.Response = NodeFetch.Response;
12
+ }
13
+ })(global);
14
+ // auto populate all extensions
15
+ import "./sp-extensions/index.js";
16
+ // export extension types as a namespace
17
+ import * as SPNS from "./sp-extensions/index.js";
18
+ export { SPNS, };
19
+ export * from "./behaviors/msal.js";
20
+ export * from "./behaviors/fetch.js";
21
+ export * from "./behaviors/proxy.js";
22
+ export * from "./behaviors/agent.js";
23
+ export * from "./behaviors/stream-parse.js";
24
+ export * from "./behaviors/spdefault.js";
25
+ export * from "./behaviors/graphdefault.js";
26
26
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@pnp/nodejs",
3
- "version": "3.0.0-v3nightly.20210905",
3
+ "version": "3.0.0-v3nightly.20210906",
4
4
  "description": "pnp - provides functionality enabling the @pnp libraries within nodejs",
5
5
  "main": "./index.js",
6
6
  "typings": "./index",
7
7
  "dependencies": {
8
8
  "@azure/msal-node": "^1.0.1",
9
- "@pnp/core": "3.0.0-v3nightly.20210905",
10
- "@pnp/logging": "3.0.0-v3nightly.20210905",
11
- "@pnp/queryable": "3.0.0-v3nightly.20210905",
12
- "@pnp/sp": "3.0.0-v3nightly.20210905",
13
- "@pnp/graph": "3.0.0-v3nightly.20210905",
9
+ "@pnp/core": "3.0.0-v3nightly.20210906",
10
+ "@pnp/logging": "3.0.0-v3nightly.20210906",
11
+ "@pnp/queryable": "3.0.0-v3nightly.20210906",
12
+ "@pnp/sp": "3.0.0-v3nightly.20210906",
13
+ "@pnp/graph": "3.0.0-v3nightly.20210906",
14
14
  "https-proxy-agent": "^5.0.0",
15
15
  "jsonwebtoken": "8.5.1",
16
16
  "node-fetch": "2.6.1",
package/readme.md CHANGED
@@ -1,22 +1,22 @@
1
- ![SharePoint Patterns and Practices](https://devofficecdn.azureedge.net/media/Default/PnP/sppnp.png)
2
-
3
- The SharePoint Patterns and Practices client side libraries were created to help enable developers to do their best work, without worrying about the exact
4
- REST api details. Built with feedback from the community they represent a way to simplify your day-to-day dev cycle while relying on tested and proven
5
- patterns.
6
-
7
- Please use [http://aka.ms/sppnp](http://aka.ms/sppnp) for the latest updates around the whole *SharePoint Patterns and Practices (PnP) initiative*.
8
-
9
- ## Source & Docs
10
-
11
- This code is managed within the [main pnp repo](https://github.com/pnp/pnpjs), please report issues and submit pull requests there.
12
-
13
- Please see the public site for [package documentation](https://pnp.github.io/pnpjs/).
14
-
15
- ### Code of Conduct
16
-
17
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
18
-
19
- ### "Sharing is Caring"
20
-
21
- ### Disclaimer
1
+ ![SharePoint Patterns and Practices](https://devofficecdn.azureedge.net/media/Default/PnP/sppnp.png)
2
+
3
+ The SharePoint Patterns and Practices client side libraries were created to help enable developers to do their best work, without worrying about the exact
4
+ REST api details. Built with feedback from the community they represent a way to simplify your day-to-day dev cycle while relying on tested and proven
5
+ patterns.
6
+
7
+ Please use [http://aka.ms/sppnp](http://aka.ms/sppnp) for the latest updates around the whole *SharePoint Patterns and Practices (PnP) initiative*.
8
+
9
+ ## Source & Docs
10
+
11
+ This code is managed within the [main pnp repo](https://github.com/pnp/pnpjs), please report issues and submit pull requests there.
12
+
13
+ Please see the public site for [package documentation](https://pnp.github.io/pnpjs/).
14
+
15
+ ### Code of Conduct
16
+
17
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
18
+
19
+ ### "Sharing is Caring"
20
+
21
+ ### Disclaimer
22
22
  **THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
@@ -1,3 +1,3 @@
1
- import "./stream.js";
2
- export * from "./stream.js";
1
+ import "./stream.js";
2
+ export * from "./stream.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,3 @@
1
- import "./stream.js";
2
- export * from "./stream.js";
1
+ import "./stream.js";
2
+ export * from "./stream.js";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,28 +1,28 @@
1
- /// <reference types="node" />
2
- import { ReadStream } from "fs";
3
- import { PassThrough } from "stream";
4
- import { TimelinePipe } from "@pnp/core";
5
- export interface IResponseBodyStream {
6
- body: PassThrough;
7
- knownLength: number;
8
- }
9
- export declare function StreamParse(): TimelinePipe;
10
- declare module "@pnp/sp/files/types" {
11
- interface IFile {
12
- /**
13
- * Gets a PassThrough stream representing the file
14
- */
15
- getStream(): Promise<IResponseBodyStream>;
16
- /**
17
- * Sets a file stream content chunk
18
- */
19
- setStreamContentChunked(stream: ReadStream, progress?: (data: IFileUploadProgressData) => void, chunkSize?: number): Promise<IFileAddResult>;
20
- }
21
- interface IFiles {
22
- /**
23
- * Adds a file stream in chunks
24
- */
25
- addChunked(url: string, content: Blob | ReadStream, progress?: (data: IFileUploadProgressData) => void, shouldOverWrite?: boolean, chunkSize?: number): Promise<IFileAddResult>;
26
- }
27
- }
1
+ /// <reference types="node" />
2
+ import { ReadStream } from "fs";
3
+ import { PassThrough } from "stream";
4
+ import { TimelinePipe } from "@pnp/core";
5
+ export interface IResponseBodyStream {
6
+ body: PassThrough;
7
+ knownLength: number;
8
+ }
9
+ export declare function StreamParse(): TimelinePipe;
10
+ declare module "@pnp/sp/files/types" {
11
+ interface IFile {
12
+ /**
13
+ * Gets a PassThrough stream representing the file
14
+ */
15
+ getStream(): Promise<IResponseBodyStream>;
16
+ /**
17
+ * Sets a file stream content chunk
18
+ */
19
+ setStreamContentChunked(stream: ReadStream, progress?: (data: IFileUploadProgressData) => void, chunkSize?: number): Promise<IFileAddResult>;
20
+ }
21
+ interface IFiles {
22
+ /**
23
+ * Adds a file stream in chunks
24
+ */
25
+ addChunked(url: string, content: Blob | ReadStream, progress?: (data: IFileUploadProgressData) => void, shouldOverWrite?: boolean, chunkSize?: number): Promise<IFileAddResult>;
26
+ }
27
+ }
28
28
  //# sourceMappingURL=stream.d.ts.map
@@ -1,6 +1,6 @@
1
- // import { getGUID, isFunc } from "@pnp/core/util";
2
- import { parseBinderWithErrorCheck } from "@pnp/queryable";
3
- export function StreamParse() {
4
- return parseBinderWithErrorCheck(async (r) => ({ body: r.body, knownLength: parseInt(r.headers.get("content-length"), 10) }));
5
- }
1
+ // import { getGUID, isFunc } from "@pnp/core/util";
2
+ import { parseBinderWithErrorCheck } from "@pnp/queryable";
3
+ export function StreamParse() {
4
+ return parseBinderWithErrorCheck(async (r) => ({ body: r.body, knownLength: parseInt(r.headers.get("content-length"), 10) }));
5
+ }
6
6
  //# sourceMappingURL=stream.js.map