gd-sprest 9.6.8 → 9.7.0

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.
@@ -86,6 +86,9 @@ export interface ITargetInfoProps {
86
86
  /** The request type. */
87
87
  requestType?: number;
88
88
 
89
+ /** The property that contains the request response. */
90
+ returnProp?: string;
91
+
89
92
  /** The url of the site/web to execute the request against. */
90
93
  url?: string;
91
94
  }
@@ -28,7 +28,9 @@ export interface Idrive {
28
28
  * Get the default library for a site.
29
29
  * @param driveId - (Optional) Sets the drive to get, otherwise gets the default drive for the site.
30
30
  * @param siteId - (Optional) The site id to target, current by default.
31
+ * @param siteUrl - (Optional) The site url to target, current by default.
31
32
  * @param targetInfo - (Optional) The target information.
33
+ * @param webId - (Optional) The web id to target.
32
34
  */
33
- (props?: { driveId?: string, siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): IBaseQuery<drive> & driveMethods;
35
+ (props?: { driveId?: string, siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps, webId?: string }): IBaseQuery<drive> & driveMethods;
34
36
  }
@@ -26,10 +26,10 @@ export const drives: Idrives;
26
26
  export interface Idrives {
27
27
  /**
28
28
  * Get the libraries for a site.
29
- * @param id - (Optional) The drive id to target.
30
29
  * @param siteId - (Optional) The site id to target, current by default.
31
30
  * @param siteUrl - (Optional) The site url to target, current by default.
32
31
  * @param targetInfo - (Optional) The target information.
32
+ * @param webId - (Optional) The web id to target.
33
33
  */
34
- (props?: { siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): driveCollection;
34
+ (props?: { siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps, webId?: string }): driveCollection;
35
35
  }
@@ -3796,6 +3796,7 @@ exports.Mapper = {
3796
3796
  },
3797
3797
  validateGroupName: {
3798
3798
  argNames: ["displayName", "alias"],
3799
+ returnProp: "ValidateGroupName"
3799
3800
  },
3800
3801
  },
3801
3802
  "SP.Directory.Group": {
@@ -5315,6 +5316,7 @@ exports.Mapper = {
5315
5316
  getUserEffectivePermissions: {
5316
5317
  argNames: ["userName"],
5317
5318
  name: "getUserEffectivePermissions(@user)?@user='[[userName]]'",
5319
+ returnProp: "GetUserEffectivePermissions",
5318
5320
  requestType: utils_1.RequestType.GetReplace
5319
5321
  },
5320
5322
  getView: {
@@ -5552,6 +5554,7 @@ exports.Mapper = {
5552
5554
  getUserEffectivePermissions: {
5553
5555
  argNames: ["userName"],
5554
5556
  name: "getUserEffectivePermissions(@user)?@user='[[userName]]'",
5557
+ returnProp: "GetUserEffectivePermissions",
5555
5558
  requestType: utils_1.RequestType.GetReplace
5556
5559
  },
5557
5560
  getVersionById: {
@@ -8521,6 +8524,7 @@ exports.Mapper = {
8521
8524
  getUserEffectivePermissions: {
8522
8525
  argNames: ["userName"],
8523
8526
  name: "getUserEffectivePermissions(@user)?@user='[[userName]]'",
8527
+ returnProp: "GetUserEffectivePermissions",
8524
8528
  requestType: utils_1.RequestType.GetReplace
8525
8529
  },
8526
8530
  getViewFromPath: {
@@ -9012,6 +9016,7 @@ exports.Mapper = {
9012
9016
  getUserEffectivePermissions: {
9013
9017
  argNames: ["userName"],
9014
9018
  name: "getUserEffectivePermissions(@user)?@user='[[userName]]'",
9019
+ returnProp: "GetUserEffectivePermissions",
9015
9020
  requestType: utils_1.RequestType.GetReplace
9016
9021
  },
9017
9022
  getVersionById: {
package/build/rest.js CHANGED
@@ -9,7 +9,7 @@ var sptypes_1 = require("./sptypes");
9
9
  * SharePoint REST Library
10
10
  */
11
11
  exports.$REST = {
12
- __ver: 9.68,
12
+ __ver: 9.69,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,
@@ -91,6 +91,7 @@ exports.Helper = {
91
91
  targetInfo.method = methodInfo.requestMethod;
92
92
  targetInfo.requestDigest = typeof (targetInfo.requestDigest) === "undefined" && base.base && base.base.targetInfo.requestDigest ? base.base.targetInfo.requestDigest : targetInfo.requestDigest;
93
93
  targetInfo.requestType = methodConfig.requestType;
94
+ targetInfo.returnProp = methodConfig.returnProp;
94
95
  // See if we are appending the endpoint
95
96
  if (methodInfo.appendEndpointFl) {
96
97
  // Append to the endpoint
@@ -217,6 +217,13 @@ exports.Request = {
217
217
  }
218
218
  }
219
219
  }
220
+ // See if a return property was set and value exists
221
+ if (base.targetInfo.returnProp && data[base.targetInfo.returnProp]) {
222
+ // Parse the data properties
223
+ for (var key in data[base.targetInfo.returnProp]) {
224
+ base[key] = data[base.targetInfo.returnProp][key];
225
+ }
226
+ }
220
227
  },
221
228
  // Method to execute the request
222
229
  execute: function (base, args) {
package/build/v2/drive.js CHANGED
@@ -20,11 +20,11 @@ exports.drive = (function (props) {
20
20
  if (drive.targetInfo.endpoint == undefined) {
21
21
  if (props.driveId) {
22
22
  // Set the endpoint
23
- drive.targetInfo.endpoint = "_api/v2.0/".concat(props.siteId ? "sites/" + props.siteId.replace(/[{}]/g, '') + "/" : "", "drives/").concat(props.driveId);
23
+ drive.targetInfo.endpoint = "_api/v2.0/".concat(props.siteId ? "sites/" + props.siteId.replace(/[{}]/g, '') + (props.webId ? "," + props.webId.replace(/^\{|\}$/g, '') : "") + "/" : "", "drives/").concat(props.driveId);
24
24
  }
25
25
  else {
26
26
  // Default the endpoint
27
- drive.targetInfo.endpoint = "_api/v2.0/".concat(props.siteId ? "sites/" + props.siteId.replace(/[{}]/g, '') + "/" : "", "drive");
27
+ drive.targetInfo.endpoint = "_api/v2.0/".concat(props.siteId ? "sites/" + props.siteId.replace(/[{}]/g, '') + (props.webId ? "," + props.webId.replace(/^\{|\}$/g, '') : "") + "/" : "", "drive");
28
28
  }
29
29
  // Add the methods
30
30
  utils_1.Request.addMethods(drive, { __metadata: { type: "@odata.context/_api/v2.0/$metadata#drive" } });
@@ -19,7 +19,7 @@ exports.drives = (function (props) {
19
19
  // See if an endpoint is not defined
20
20
  if (drives.targetInfo.endpoint == undefined) {
21
21
  // Default the endpoint
22
- drives.targetInfo.endpoint = "_api/v2.0/".concat(props.siteId ? "sites/" + props.siteId.replace(/[{}]/g, '') + "/" : "", "drives");
22
+ drives.targetInfo.endpoint = "_api/v2.0/".concat(props.siteId ? "sites/" + props.siteId.replace(/[{}]/g, '') + (props.webId ? "," + props.webId.replace(/^\{|\}$/g, '') : "") + "/" : "", "drives");
23
23
  // Add the methods
24
24
  utils_1.Request.addMethods(drives, { __metadata: { type: "@odata.context/_api/v2.0/$metadata#drives" } });
25
25
  }
@@ -4710,9 +4710,11 @@ declare module 'gd-sprest/v2/drive' {
4710
4710
  * Get the default library for a site.
4711
4711
  * @param driveId - (Optional) Sets the drive to get, otherwise gets the default drive for the site.
4712
4712
  * @param siteId - (Optional) The site id to target, current by default.
4713
+ * @param siteUrl - (Optional) The site url to target, current by default.
4713
4714
  * @param targetInfo - (Optional) The target information.
4715
+ * @param webId - (Optional) The web id to target.
4714
4716
  */
4715
- (props?: { driveId?: string, siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): IBaseQuery<drive> & driveMethods;
4717
+ (props?: { driveId?: string, siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps, webId?: string }): IBaseQuery<drive> & driveMethods;
4716
4718
  }
4717
4719
  }
4718
4720
 
@@ -4745,12 +4747,12 @@ declare module 'gd-sprest/v2/drives' {
4745
4747
  export interface Idrives {
4746
4748
  /**
4747
4749
  * Get the libraries for a site.
4748
- * @param id - (Optional) The drive id to target.
4749
4750
  * @param siteId - (Optional) The site id to target, current by default.
4750
4751
  * @param siteUrl - (Optional) The site url to target, current by default.
4751
4752
  * @param targetInfo - (Optional) The target information.
4753
+ * @param webId - (Optional) The web id to target.
4752
4754
  */
4753
- (props?: { siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): driveCollection;
4755
+ (props?: { siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps, webId?: string }): driveCollection;
4754
4756
  }
4755
4757
  }
4756
4758
 
@@ -7705,6 +7707,9 @@ declare module 'gd-sprest/utils/targetInfo' {
7705
7707
  /** The request type. */
7706
7708
  requestType?: number;
7707
7709
 
7710
+ /** The property that contains the request response. */
7711
+ returnProp?: string;
7712
+
7708
7713
  /** The url of the site/web to execute the request against. */
7709
7714
  url?: string;
7710
7715
  }