gd-sprest 9.5.9 → 9.6.1
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/@types/lib/web.d.ts +2 -2
- package/build/lib/web.js +16 -4
- package/build/rest.js +1 -1
- package/build/utils/request.js +2 -2
- package/dist/gd-sprest.d.ts +2 -2
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.min.js +1 -1
- package/package.json +1 -1
package/@types/lib/web.d.ts
CHANGED
|
@@ -47,9 +47,9 @@ export interface IWeb {
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Method to return the web of the current user's OneDrive.
|
|
50
|
-
* @param
|
|
50
|
+
* @param targetInfo - (Optional) The target information.
|
|
51
51
|
*/
|
|
52
|
-
getOneDrive(
|
|
52
|
+
getOneDrive(targetInfo?: ITargetInfoProps): SP.IWeb;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Method to get a remote web.
|
package/build/lib/web.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.Web = void 0;
|
|
4
15
|
var contextInfo_1 = require("./contextInfo");
|
|
@@ -20,18 +31,19 @@ exports.Web = (function (url, targetInfo) {
|
|
|
20
31
|
return web;
|
|
21
32
|
});
|
|
22
33
|
// Method to get the onedive web for the current user
|
|
23
|
-
exports.Web.getOneDrive = function (
|
|
34
|
+
exports.Web.getOneDrive = function (targetInfo) {
|
|
35
|
+
if (targetInfo === void 0) { targetInfo = {}; }
|
|
24
36
|
// Set the url of the drive
|
|
25
37
|
var host = document.location.host.split('.');
|
|
26
38
|
var url = "https://".concat(host[0], "-my.").concat(host[1], ".").concat(host[2], "/personal/").concat(contextInfo_1.ContextInfo.userPrincipalName.replace(/[@,.]/g, '_'));
|
|
27
39
|
// Return the web for the user's onedrive
|
|
28
|
-
return (0, exports.Web)(url, {
|
|
40
|
+
return (0, exports.Web)(url, __assign(__assign({}, targetInfo), {
|
|
29
41
|
requestHeader: {
|
|
30
|
-
Authorization: "Bearer " +
|
|
42
|
+
Authorization: "Bearer " + graph_1.Graph.Token,
|
|
31
43
|
Accept: "application/json",
|
|
32
44
|
"Content-Type": "application/json"
|
|
33
45
|
}
|
|
34
|
-
});
|
|
46
|
+
}));
|
|
35
47
|
};
|
|
36
48
|
// Static method to get a remote web
|
|
37
49
|
exports.Web.getRemoteWeb = (function (requestUrl) {
|
package/build/rest.js
CHANGED
package/build/utils/request.js
CHANGED
|
@@ -606,13 +606,13 @@ exports.Request = {
|
|
|
606
606
|
helper_1.Helper.updateSearchResults(obj);
|
|
607
607
|
}
|
|
608
608
|
// Else, see if this is a graph request
|
|
609
|
-
else if (data["@odata.context"]) {
|
|
609
|
+
else if (data["@odata.context"] || data["odata.type"]) {
|
|
610
610
|
// Save a reference to it
|
|
611
611
|
obj["d"] = data;
|
|
612
612
|
// Update the base object's properties
|
|
613
613
|
exports.Request.addProperties(obj, data);
|
|
614
614
|
// Add the methods
|
|
615
|
-
exports.Request.addMethods(obj, data, data["@odata.context"]);
|
|
615
|
+
exports.Request.addMethods(obj, data, data["@odata.context"] || data["odata.type"]);
|
|
616
616
|
// See if we are not bypassing the processing of the response
|
|
617
617
|
if (base.targetInfo.disableProcessing != true) {
|
|
618
618
|
// Update the data collection
|
package/dist/gd-sprest.d.ts
CHANGED
|
@@ -4568,9 +4568,9 @@ declare module 'gd-sprest/lib/web' {
|
|
|
4568
4568
|
|
|
4569
4569
|
/**
|
|
4570
4570
|
* Method to return the web of the current user's OneDrive.
|
|
4571
|
-
* @param
|
|
4571
|
+
* @param targetInfo - (Optional) The target information.
|
|
4572
4572
|
*/
|
|
4573
|
-
getOneDrive(
|
|
4573
|
+
getOneDrive(targetInfo?: ITargetInfoProps): SP.IWeb;
|
|
4574
4574
|
|
|
4575
4575
|
/**
|
|
4576
4576
|
* Method to get a remote web.
|