gd-sprest 8.3.9 → 8.4.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/v2/drive.d.ts +2 -2
- package/@types/v2/drives.d.ts +3 -2
- package/@types/v2/sites.d.ts +1 -1
- package/build/helper/spCfg.js +0 -19
- package/build/lib/web.js +1 -0
- package/build/mapper/v2.js +15 -0
- package/build/rest.js +1 -1
- package/build/v2/drive.js +5 -4
- package/build/v2/drives.js +15 -5
- package/build/v2/sites.js +4 -3
- package/dist/gd-sprest.d.ts +6 -5
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.min.js +1 -1
- package/package.json +1 -1
package/@types/v2/drive.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ export const drive: Idrive;
|
|
|
26
26
|
export interface Idrive {
|
|
27
27
|
/**
|
|
28
28
|
* Get the default library for a site.
|
|
29
|
-
* @param
|
|
29
|
+
* @param siteId - (Optional) The site id to target, current by default.
|
|
30
30
|
* @param targetInfo - (Optional) The target information.
|
|
31
31
|
*/
|
|
32
|
-
(
|
|
32
|
+
(props?: { siteId?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<drive>;
|
|
33
33
|
}
|
package/@types/v2/drives.d.ts
CHANGED
|
@@ -26,8 +26,9 @@ export const drives: Idrives;
|
|
|
26
26
|
export interface Idrives {
|
|
27
27
|
/**
|
|
28
28
|
* Get the libraries for a site.
|
|
29
|
-
* @param id - (Optional) The
|
|
29
|
+
* @param id - (Optional) The drive id to target.
|
|
30
|
+
* @param siteId - (Optional) The site id to target, current by default.
|
|
30
31
|
* @param targetInfo - (Optional) The target information.
|
|
31
32
|
*/
|
|
32
|
-
(id?: string, targetInfo?: ITargetInfoProps): IBaseExecution<driveCollection>;
|
|
33
|
+
(props?: { id?: string, siteId?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<driveCollection>;
|
|
33
34
|
}
|
package/@types/v2/sites.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface Isites {
|
|
|
30
30
|
* @param id - (Optional) The site id to target, current by default.
|
|
31
31
|
* @param targetInfo - (Optional) The target information.
|
|
32
32
|
*/
|
|
33
|
-
(id?: string, targetInfo?: ITargetInfoProps): siteMethods & sites;
|
|
33
|
+
(props?: { id?: string, targetInfo?: ITargetInfoProps }): siteMethods & sites;
|
|
34
34
|
|
|
35
35
|
/** Returns the current web. */
|
|
36
36
|
static getCurrentWeb(): IBaseExecution<sites> & siteMethods;
|
package/build/helper/spCfg.js
CHANGED
|
@@ -54,25 +54,6 @@ exports.SPConfig = function (cfg, webUrl) {
|
|
|
54
54
|
resolve();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
// Method to add an existing content type
|
|
58
|
-
var addParentCT = function (cfg, parentInfo) {
|
|
59
|
-
// Return a promise
|
|
60
|
-
return new Promise(function (resolve, reject) {
|
|
61
|
-
// Add the content type
|
|
62
|
-
var contentTypes = list ? lib_1.Web(webUrl, { disableCache: true, requestDigest: _requestDigest }).Lists(list.Title).ContentTypes() : lib_1.Web(webUrl).ContentTypes();
|
|
63
|
-
contentTypes.add({
|
|
64
|
-
Description: cfg.Description,
|
|
65
|
-
Group: cfg.Group,
|
|
66
|
-
Name: cfg.Name,
|
|
67
|
-
Id: {
|
|
68
|
-
__metadata: {
|
|
69
|
-
type: "SP.ContentTypeId"
|
|
70
|
-
},
|
|
71
|
-
StringValue: parentInfo.Id + (list ? "00" : "") + lib_1.ContextInfo.generateGUID().replace(/-/g, "")
|
|
72
|
-
}
|
|
73
|
-
}).execute(resolve, reject);
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
57
|
// Method to get the parent content type
|
|
77
58
|
var getParentCT = function (ctName, url) {
|
|
78
59
|
// Return a promise
|
package/build/lib/web.js
CHANGED
package/build/mapper/v2.js
CHANGED
|
@@ -78,6 +78,9 @@ exports.MapperV2 = {
|
|
|
78
78
|
requestType: utils_1.RequestType.Get
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
|
+
drives: {
|
|
82
|
+
query: { argNames: ["oData"], requestType: utils_1.RequestType.OData }
|
|
83
|
+
},
|
|
81
84
|
item: {
|
|
82
85
|
permissions: {
|
|
83
86
|
requestType: utils_1.RequestType.Get
|
|
@@ -116,6 +119,14 @@ exports.MapperV2 = {
|
|
|
116
119
|
requestType: utils_1.RequestType.Get
|
|
117
120
|
}
|
|
118
121
|
},
|
|
122
|
+
items: {
|
|
123
|
+
add: {
|
|
124
|
+
args: ["values"],
|
|
125
|
+
name: "",
|
|
126
|
+
requestType: utils_1.RequestType.PostBodyNoArgs
|
|
127
|
+
},
|
|
128
|
+
query: { argNames: ["oData"], requestType: utils_1.RequestType.OData },
|
|
129
|
+
},
|
|
119
130
|
list: {
|
|
120
131
|
activities: {
|
|
121
132
|
requestType: utils_1.RequestType.Get
|
|
@@ -152,6 +163,10 @@ exports.MapperV2 = {
|
|
|
152
163
|
requestType: utils_1.RequestType.GetWithArgsValueOnly,
|
|
153
164
|
returnType: "analytics"
|
|
154
165
|
},
|
|
166
|
+
assignSensitivityLabel: {
|
|
167
|
+
argNames: ["values"],
|
|
168
|
+
requestType: utils_1.RequestType.PostBodyNoArgs
|
|
169
|
+
},
|
|
155
170
|
driveItem: {
|
|
156
171
|
requestType: utils_1.RequestType.Get,
|
|
157
172
|
returnType: "driveItem"
|
package/build/rest.js
CHANGED
package/build/v2/drive.js
CHANGED
|
@@ -7,18 +7,19 @@ var utils_1 = require("../utils");
|
|
|
7
7
|
* Drive
|
|
8
8
|
* Returns the default library for a site.
|
|
9
9
|
*/
|
|
10
|
-
exports.drive = (function (
|
|
10
|
+
exports.drive = (function (props) {
|
|
11
11
|
var _a;
|
|
12
|
-
|
|
12
|
+
if (props === void 0) { props = {}; }
|
|
13
|
+
var drive = new utils_1.Base(props.targetInfo);
|
|
13
14
|
// Default the properties
|
|
14
15
|
drive.targetInfo.defaultToWebFl = true;
|
|
15
16
|
drive.targetInfo.requestType = utils_1.RequestType.GraphGet;
|
|
16
17
|
// See if an endpoint is not defined
|
|
17
18
|
if (drive.targetInfo.endpoint == undefined) {
|
|
18
19
|
// Default the endpoint
|
|
19
|
-
drive.targetInfo.endpoint = "_api/v2.0/sites/" + (
|
|
20
|
+
drive.targetInfo.endpoint = "_api/v2.0/sites/" + (props.siteId || ((_a = contextInfo_1.ContextInfo === null || contextInfo_1.ContextInfo === void 0 ? void 0 : contextInfo_1.ContextInfo.siteId) === null || _a === void 0 ? void 0 : _a.replace(/[{}]/g, '')) + "/drive");
|
|
20
21
|
// Add the methods
|
|
21
|
-
|
|
22
|
+
utils_1.Request.addMethods(drive, { __metadata: { type: "@odata.context/_api/v2.0/$metadata#drive" } });
|
|
22
23
|
}
|
|
23
24
|
// Return the default library
|
|
24
25
|
return drive;
|
package/build/v2/drives.js
CHANGED
|
@@ -7,18 +7,28 @@ var utils_1 = require("../utils");
|
|
|
7
7
|
* Drives
|
|
8
8
|
* Returns the libraries for a site.
|
|
9
9
|
*/
|
|
10
|
-
exports.drives = (function (
|
|
10
|
+
exports.drives = (function (props) {
|
|
11
11
|
var _a;
|
|
12
|
-
|
|
12
|
+
if (props === void 0) { props = {}; }
|
|
13
|
+
var drives = new utils_1.Base(props.targetInfo);
|
|
13
14
|
// Default the properties
|
|
14
15
|
drives.targetInfo.defaultToWebFl = true;
|
|
15
16
|
drives.targetInfo.requestType = utils_1.RequestType.GraphGet;
|
|
16
17
|
// See if an endpoint is not defined
|
|
17
18
|
if (drives.targetInfo.endpoint == undefined) {
|
|
18
19
|
// Default the endpoint
|
|
19
|
-
drives.targetInfo.endpoint = "_api/v2.0/sites/" + (
|
|
20
|
-
//
|
|
21
|
-
|
|
20
|
+
drives.targetInfo.endpoint = "_api/v2.0/sites/" + (props.siteId || ((_a = contextInfo_1.ContextInfo === null || contextInfo_1.ContextInfo === void 0 ? void 0 : contextInfo_1.ContextInfo.siteId) === null || _a === void 0 ? void 0 : _a.replace(/[{}]/g, '')) + "/drives");
|
|
21
|
+
// See if the drive id was provided
|
|
22
|
+
if (props.driveId) {
|
|
23
|
+
// Append the id
|
|
24
|
+
drives.targetInfo.endpoint += "/" + props.driveId;
|
|
25
|
+
// Add the methods
|
|
26
|
+
utils_1.Request.addMethods(drives, { __metadata: { type: "@odata.context/_api/v2.0/$metadata#drive" } });
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// Add the methods
|
|
30
|
+
utils_1.Request.addMethods(drives, { __metadata: { type: "@odata.context/_api/v2.0/$metadata#drives" } });
|
|
31
|
+
}
|
|
22
32
|
}
|
|
23
33
|
// Return the libraries
|
|
24
34
|
return drives;
|
package/build/v2/sites.js
CHANGED
|
@@ -7,12 +7,13 @@ var utils_1 = require("../utils");
|
|
|
7
7
|
* Sites
|
|
8
8
|
* The sites graph endpoint.
|
|
9
9
|
*/
|
|
10
|
-
exports.sites = (function (
|
|
10
|
+
exports.sites = (function (props) {
|
|
11
11
|
var _a;
|
|
12
|
-
|
|
12
|
+
if (props === void 0) { props = {}; }
|
|
13
|
+
var sites = new utils_1.Base(props.targetInfo);
|
|
13
14
|
// Default the properties
|
|
14
15
|
sites.targetInfo.defaultToWebFl = true;
|
|
15
|
-
sites.targetInfo.endpoint = "_api/v2.0/sites/" + (
|
|
16
|
+
sites.targetInfo.endpoint = "_api/v2.0/sites/" + (props.siteId || ((_a = contextInfo_1.ContextInfo === null || contextInfo_1.ContextInfo === void 0 ? void 0 : contextInfo_1.ContextInfo.siteId) === null || _a === void 0 ? void 0 : _a.replace(/[{}]/g, '')));
|
|
16
17
|
sites.targetInfo.requestType = utils_1.RequestType.GraphGet;
|
|
17
18
|
// Add the methods
|
|
18
19
|
utils_1.Request.addMethods(sites, { __metadata: { type: "@odata.context/_api/v2.0/$metadata#sites" } });
|
package/dist/gd-sprest.d.ts
CHANGED
|
@@ -4465,10 +4465,10 @@ declare module 'gd-sprest/v2/drive' {
|
|
|
4465
4465
|
export interface Idrive {
|
|
4466
4466
|
/**
|
|
4467
4467
|
* Get the default library for a site.
|
|
4468
|
-
* @param
|
|
4468
|
+
* @param siteId - (Optional) The site id to target, current by default.
|
|
4469
4469
|
* @param targetInfo - (Optional) The target information.
|
|
4470
4470
|
*/
|
|
4471
|
-
(
|
|
4471
|
+
(props?: { siteId?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<drive>;
|
|
4472
4472
|
}
|
|
4473
4473
|
}
|
|
4474
4474
|
|
|
@@ -4501,10 +4501,11 @@ declare module 'gd-sprest/v2/drives' {
|
|
|
4501
4501
|
export interface Idrives {
|
|
4502
4502
|
/**
|
|
4503
4503
|
* Get the libraries for a site.
|
|
4504
|
-
* @param id - (Optional) The
|
|
4504
|
+
* @param id - (Optional) The drive id to target.
|
|
4505
|
+
* @param siteId - (Optional) The site id to target, current by default.
|
|
4505
4506
|
* @param targetInfo - (Optional) The target information.
|
|
4506
4507
|
*/
|
|
4507
|
-
(id?: string, targetInfo?: ITargetInfoProps): IBaseExecution<driveCollection>;
|
|
4508
|
+
(props?: { id?: string, siteId?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<driveCollection>;
|
|
4508
4509
|
}
|
|
4509
4510
|
}
|
|
4510
4511
|
|
|
@@ -4541,7 +4542,7 @@ declare module 'gd-sprest/v2/sites' {
|
|
|
4541
4542
|
* @param id - (Optional) The site id to target, current by default.
|
|
4542
4543
|
* @param targetInfo - (Optional) The target information.
|
|
4543
4544
|
*/
|
|
4544
|
-
(id?: string, targetInfo?: ITargetInfoProps): siteMethods & sites;
|
|
4545
|
+
(props?: { id?: string, targetInfo?: ITargetInfoProps }): siteMethods & sites;
|
|
4545
4546
|
|
|
4546
4547
|
/** Returns the current web. */
|
|
4547
4548
|
static getCurrentWeb(): IBaseExecution<sites> & siteMethods;
|