@pnp/nodejs 4.0.1 → 4.1.0-v4nightly.20240528
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphdefault.d.ts","sourceRoot":"","sources":["../../../../packages/nodejs/behaviors/graphdefault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"graphdefault.d.ts","sourceRoot":"","sources":["../../../../packages/nodejs/behaviors/graphdefault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAW,YAAY,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAgB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAKzD,MAAM,WAAW,kBAAkB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE;QACH,MAAM,EAAE,aAAa,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACL;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,kBAAkB,GAAG,YAAY,CAAC,SAAS,CAAC,CAoBhF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { combine
|
|
1
|
+
import { combine } from "@pnp/core";
|
|
2
2
|
import { DefaultParse } from "@pnp/queryable";
|
|
3
|
-
import { DefaultHeaders, DefaultInit } from "@pnp/graph";
|
|
3
|
+
import { DEFAULT_GRAPH_URL, DefaultHeaders, DefaultInit } from "@pnp/graph";
|
|
4
4
|
import { NodeFetchWithRetry } from "./fetch.js";
|
|
5
5
|
import { MSAL } from "./msal.js";
|
|
6
6
|
/**
|
|
@@ -9,25 +9,17 @@ import { MSAL } from "./msal.js";
|
|
|
9
9
|
* props.msal: (deprecated, use separate MSAL behavior)
|
|
10
10
|
*/
|
|
11
11
|
export function GraphDefault(props) {
|
|
12
|
-
if ((props === null || props === void 0 ? void 0 : props.baseUrl) && !isUrlAbsolute(props === null || props === void 0 ? void 0 : props.baseUrl)) {
|
|
13
|
-
throw Error("GraphDefault props.baseUrl must be absolute when supplied.");
|
|
14
|
-
}
|
|
15
12
|
const { baseUrl, msal } = {
|
|
16
|
-
baseUrl:
|
|
13
|
+
baseUrl: DEFAULT_GRAPH_URL,
|
|
17
14
|
...props,
|
|
18
15
|
};
|
|
19
16
|
return (instance) => {
|
|
20
|
-
const behaviors = [DefaultHeaders(), DefaultInit(), NodeFetchWithRetry(), DefaultParse()];
|
|
17
|
+
const behaviors = [DefaultHeaders(), DefaultInit(baseUrl), NodeFetchWithRetry(), DefaultParse()];
|
|
21
18
|
if (props === null || props === void 0 ? void 0 : props.msal) {
|
|
22
|
-
|
|
19
|
+
const u = new URL(baseUrl);
|
|
20
|
+
behaviors.push(MSAL(msal.config, (msal === null || msal === void 0 ? void 0 : msal.scopes) || [combine(`${u.protocol}//${u.host}`, ".default")]));
|
|
23
21
|
}
|
|
24
22
|
instance.using(...behaviors);
|
|
25
|
-
instance.on.pre(async (url, init, result) => {
|
|
26
|
-
if (!isUrlAbsolute(url)) {
|
|
27
|
-
url = combine(baseUrl, url);
|
|
28
|
-
}
|
|
29
|
-
return [url, init, result];
|
|
30
|
-
});
|
|
31
23
|
return instance;
|
|
32
24
|
};
|
|
33
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphdefault.js","sourceRoot":"","sources":["../../../../packages/nodejs/behaviors/graphdefault.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"graphdefault.js","sourceRoot":"","sources":["../../../../packages/nodejs/behaviors/graphdefault.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,YAAY,EAAa,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAUjC;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAA0B;IAEnD,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG;QACtB,OAAO,EAAE,iBAAiB;QAC1B,GAAG,KAAK;KACX,CAAC;IAEF,OAAO,CAAC,QAAmB,EAAE,EAAE;QAE3B,MAAM,SAAS,GAAwB,CAAC,cAAc,EAAE,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;QAEtH,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,EAAE;YACb,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;YAC3B,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,KAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;SACxG;QAED,QAAQ,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;QAE7B,OAAO,QAAQ,CAAC;IACpB,CAAC,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/nodejs",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.1.0-v4nightly.20240528",
|
|
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
|
-
"@azure/msal-node": "2.
|
|
9
|
-
"@pnp/core": "4.0.
|
|
10
|
-
"@pnp/logging": "4.0.
|
|
11
|
-
"@pnp/queryable": "4.0.
|
|
12
|
-
"@pnp/sp": "4.0.
|
|
13
|
-
"@pnp/graph": "4.0.
|
|
8
|
+
"@azure/msal-node": "2.8.1",
|
|
9
|
+
"@pnp/core": "4.1.0-v4nightly.20240528",
|
|
10
|
+
"@pnp/logging": "4.1.0-v4nightly.20240528",
|
|
11
|
+
"@pnp/queryable": "4.1.0-v4nightly.20240528",
|
|
12
|
+
"@pnp/sp": "4.1.0-v4nightly.20240528",
|
|
13
|
+
"@pnp/graph": "4.1.0-v4nightly.20240528",
|
|
14
14
|
"node-fetch": "3.3.2",
|
|
15
15
|
"tslib": "2.6.2"
|
|
16
16
|
},
|