gd-sprest 9.1.4 → 9.1.6

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.
@@ -26,8 +26,9 @@ export const drive: Idrive;
26
26
  export interface Idrive {
27
27
  /**
28
28
  * Get the default library for a site.
29
+ * @param driveId - (Optional) Sets the drive to get, otherwise gets the default drive for the site.
29
30
  * @param siteId - (Optional) The site id to target, current by default.
30
31
  * @param targetInfo - (Optional) The target information.
31
32
  */
32
- (props?: { siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<drive>;
33
+ (props?: { driveId?: string, siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<drive>;
33
34
  }
@@ -31,5 +31,5 @@ export interface Idrives {
31
31
  * @param siteUrl - (Optional) The site url to target, current by default.
32
32
  * @param targetInfo - (Optional) The target information.
33
33
  */
34
- (props?: { driveId?: string, siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): driveCollection;
34
+ (props?: { siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): driveCollection;
35
35
  }
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.14,
12
+ __ver: 9.16,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,
package/build/v2/drive.js CHANGED
@@ -18,8 +18,14 @@ exports.drive = (function (props) {
18
18
  drive.targetInfo.url = props.siteUrl || ((_a = props === null || props === void 0 ? void 0 : props.targetInfo) === null || _a === void 0 ? void 0 : _a.url) || contextInfo_1.ContextInfo.webServerRelativeUrl;
19
19
  // See if an endpoint is not defined
20
20
  if (drive.targetInfo.endpoint == undefined) {
21
- // Default the endpoint
22
- drive.targetInfo.endpoint = "_api/v2.0/".concat(props.siteId ? "sites/" + props.siteId.replace(/[{}]/g, '') : "", "drive");
21
+ if (props.driveId) {
22
+ // Set the endpoint
23
+ drive.targetInfo.endpoint = "_api/v2.0/".concat(props.siteId ? "sites/" + props.siteId.replace(/[{}]/g, '') + "/" : "", "drives/").concat(props.driveId);
24
+ }
25
+ else {
26
+ // Default the endpoint
27
+ drive.targetInfo.endpoint = "_api/v2.0/".concat(props.siteId ? "sites/" + props.siteId.replace(/[{}]/g, '') + "/" : "", "drive");
28
+ }
23
29
  // Add the methods
24
30
  utils_1.Request.addMethods(drive, { __metadata: { type: "@odata.context/_api/v2.0/$metadata#drive" } });
25
31
  }
@@ -19,18 +19,9 @@ 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");
23
- // See if the drive id was provided
24
- if (props.driveId) {
25
- // Append the id
26
- drives.targetInfo.endpoint += "/" + props.driveId;
27
- // Add the methods
28
- utils_1.Request.addMethods(drives, { __metadata: { type: "@odata.context/_api/v2.0/$metadata#drive" } });
29
- }
30
- else {
31
- // Add the methods
32
- utils_1.Request.addMethods(drives, { __metadata: { type: "@odata.context/_api/v2.0/$metadata#drives" } });
33
- }
22
+ drives.targetInfo.endpoint = "_api/v2.0/".concat(props.siteId ? "sites/" + props.siteId.replace(/[{}]/g, '') + "/" : "", "drives");
23
+ // Add the methods
24
+ utils_1.Request.addMethods(drives, { __metadata: { type: "@odata.context/_api/v2.0/$metadata#drives" } });
34
25
  }
35
26
  // Return the libraries
36
27
  return drives;
@@ -4483,10 +4483,11 @@ declare module 'gd-sprest/v2/drive' {
4483
4483
  export interface Idrive {
4484
4484
  /**
4485
4485
  * Get the default library for a site.
4486
+ * @param driveId - (Optional) Sets the drive to get, otherwise gets the default drive for the site.
4486
4487
  * @param siteId - (Optional) The site id to target, current by default.
4487
4488
  * @param targetInfo - (Optional) The target information.
4488
4489
  */
4489
- (props?: { siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<drive>;
4490
+ (props?: { driveId?: string, siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<drive>;
4490
4491
  }
4491
4492
  }
4492
4493
 
@@ -4524,7 +4525,7 @@ declare module 'gd-sprest/v2/drives' {
4524
4525
  * @param siteUrl - (Optional) The site url to target, current by default.
4525
4526
  * @param targetInfo - (Optional) The target information.
4526
4527
  */
4527
- (props?: { driveId?: string, siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): driveCollection;
4528
+ (props?: { siteId?: string, siteUrl?: string, targetInfo?: ITargetInfoProps }): driveCollection;
4528
4529
  }
4529
4530
  }
4530
4531