gd-sprest 9.3.7 → 9.3.9

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/index.d.ts CHANGED
@@ -4,13 +4,13 @@
4
4
  import {
5
5
  Apps, ContextInfo, DirectorySession, Graph, GroupService, GroupSiteManager, HubSites,
6
6
  HubSitesUtility, List, Navigation, PeopleManager, PeoplePicker, ProfileLoader, Search,
7
- Site, SiteIconManager, SiteManager, SitePages, SocialFeed, ThemeManager, UserProfile,
7
+ SensitivityLabels, Site, SiteIconManager, SiteManager, SitePages, SocialFeed, ThemeManager, UserProfile,
8
8
  Utility, Web, WebTemplateExtensions, WorkflowInstanceService, WorkflowSubscriptionService
9
9
  } from "./lib";
10
10
  export {
11
11
  Apps, ContextInfo, DirectorySession, Graph, GroupService, GroupSiteManager, HubSites,
12
12
  HubSitesUtility, List, Navigation, PeopleManager, PeoplePicker, ProfileLoader, Search,
13
- Site, SiteIconManager, SiteManager, SitePages, SocialFeed, ThemeManager, UserProfile,
13
+ SensitivityLabels, Site, SiteIconManager, SiteManager, SitePages, SocialFeed, ThemeManager, UserProfile,
14
14
  Utility, Web, WebTemplateExtensions, WorkflowInstanceService, WorkflowSubscriptionService
15
15
  }
16
16
 
@@ -1,4 +1,4 @@
1
- import { IBaseExecution } from "gd-sprest-def/lib/base";
1
+ import { IBaseCollection } from "gd-sprest-def/lib/base";
2
2
  import { ISensitivityLabelCollection } from "gd-sprest-def/lib/SP/entitytypes";
3
3
  import { ITargetInfoProps } from "../utils";
4
4
 
@@ -18,5 +18,132 @@ export interface ISensitivityLabels {
18
18
  * @param url - (Optional) The web url.
19
19
  * @param targetInfo - (Optional) The target information.
20
20
  */
21
- (url?: string, targetInfo?: ITargetInfoProps): IBaseExecution<ISensitivityLabelCollection>;
21
+ (url?: string, targetInfo?: ITargetInfoProps): ISensitivityLabelCollection;
22
+
23
+ // Gets the sensitivity labels for this user.
24
+ getLabelsForUser(): IBaseCollection<ISensitivityLabelResult>;
25
+ }
26
+
27
+ /**
28
+ * Sensitivity Label Result
29
+ */
30
+ export interface ISensitivityLabel {
31
+ apiLabelVersion: string;
32
+ applicableTo: string;
33
+ applicationMode: string;
34
+ assignedPolicies: [{
35
+ id: string;
36
+ name: string;
37
+ }]
38
+ autoLabeling: boolean;
39
+ color: string;
40
+ customSettings: [{
41
+ name: string;
42
+ value: string;
43
+ }]
44
+ defaultSubLabelId: string;
45
+ description: string;
46
+ displayName: string;
47
+ id: string;
48
+ isDefault: boolean;
49
+ isEnabled: boolean;
50
+ isEndpointProtectionEnabled: boolean;
51
+ isParent: boolean;
52
+ isSmimeEncryptEnabled: boolean;
53
+ isSmimeSignEnabled: boolean;
54
+ labelActions: [any];
55
+ name: string;
56
+ priority: number;
57
+ tooltip: string;
58
+ }
59
+
60
+ /**
61
+ * Sensitivity Label Result
62
+ */
63
+ export interface ISensitivityLabelResult extends ISensitivityLabel {
64
+ defaultContentLabel: string;
65
+ "defaultContentLabel@data.context": string;
66
+ sensitivityPolicySettings: {
67
+ analyticsSettings: {
68
+ isAuditEnabled: boolean;
69
+ isLogMatchedContentEnabled: boolean;
70
+ }
71
+ applicableTo: string;
72
+ attachmentActionSettings: {
73
+ attachmentAction: string;
74
+ attachmentActionTip: string;
75
+ }
76
+ containerSettings: {
77
+ isSiteAndGroupMandatory: boolean;
78
+ }
79
+ customSettings: [any];
80
+ downgradeSensitivityRequiresJustification: boolean;
81
+ fileExplorerSettings: {
82
+ isCustomPermissionsEnabled: boolean;
83
+ isCustomPermissionsForCustomProtectedFilesEnabled: boolean;
84
+ }
85
+ generalSettings: {
86
+ isContainerSupportEnabled: boolean;
87
+ isHideBarByDefaultEnabled: boolean;
88
+ isLabelByEmailHeaderEnabled: boolean;
89
+ isPostponeMandatoryBeforeSaveEnabled: boolean;
90
+ isPowerbiMandatory: boolean;
91
+ isRevokeGuiSupportEnabled: boolean;
92
+ isRunPolicyInBackgroundEnabled: boolean;
93
+ isTrackAndRevokeEnabled: boolean;
94
+ isUseCopyAndPreserveFileSystemOwnerEnabled: boolean;
95
+ justificationTextForUserText: string;
96
+ pfileReformatExtensions: string[];
97
+ pfileSupportedExtensions: string[];
98
+ reportAnIssueLink: string;
99
+ }
100
+ helpWebUrl: string;
101
+ id: string;
102
+ inheritanceLabelSettings: {
103
+ applyLabelToArtifacts: boolean;
104
+ inheritLabelFromFile: string;
105
+ }
106
+ isMandatory: boolean;
107
+ outlookEmailSettings: {
108
+ defaultLabel: string;
109
+ isDistributionListExpansionEnabled: boolean;
110
+ isMandatoryDisabled: boolean;
111
+ isRecommendationEnabled: boolean;
112
+ isSkipSmimeOnReadingPaneEnabled: boolean;
113
+ outlookGetEmailAddressesTimeOutMSProperty: string;
114
+ overrideUnlabledCollaborationExtenstions: string[];
115
+ unlabeledCollaborationActionOverrideMailBodyBehavior: string;
116
+ }
117
+ outlookPopupMessageSettings: {
118
+ blockTrustedDomains: string[];
119
+ blockUntrustedCollaborationLabels: string[];
120
+ justifyTrustedDomains: string[];
121
+ justifyUntrustedCollaborationLabels: string[];
122
+ warnTrustedDomains: string[];
123
+ warnUntrustedCollaborationLabels: string[];
124
+ }
125
+ performanceSettings: {
126
+ officeContentExtractionTimeout: number;
127
+ scannerMaxCPU: number;
128
+ scannerMaxThreadCount: number;
129
+ scannerMinCPU: number;
130
+ sharepointFileWebRequestTimeout: number;
131
+ sharepointWebRequestTimeout: number;
132
+ skippedScannerFileSystemAttributes: string[];
133
+ }
134
+ powerpointSettings: {
135
+ isRemoveExternalMarkingFromCustomLayoutsEnabled: boolean;
136
+ removeAllShapesByShapeName: boolean;
137
+ shapeNameToRemove: string;
138
+ }
139
+ siteAndGroupDefaultLabel: ISensitivityLabel;
140
+ unifiedPolicySettings: {
141
+ classificationScheme: string;
142
+ isLabelCoauthEnabled: boolean;
143
+ isPurviewLabelConsentAvailable: boolean;
144
+ }
145
+ }
146
+ "sensitivityPolicySettings@data.context": string;
147
+ sublabels: ISensitivityLabelResult[];
148
+ "sublabels@data.context": string;
22
149
  }
@@ -15,3 +15,7 @@ exports.SensitivityLabels = (function (targetInfo) {
15
15
  // Return the sensitivity labels
16
16
  return sensitivityLabels;
17
17
  });
18
+ exports.SensitivityLabels.getLabelsForUser = function () {
19
+ // Call the method w/ default parameters
20
+ return (0, exports.SensitivityLabels)().getSensitivityLabelsAsStream("sensitivityPolicySettings,sublabels($expand=sensitivityPolicySettings)", "applicableto has ''file''");
21
+ };
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.37,
12
+ __ver: 9.39,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,
@@ -71,23 +71,23 @@ var Batch = /** @class */ (function () {
71
71
  // See if this is v2
72
72
  if (isV2) {
73
73
  // Create the batch requests
74
- batchRequests = Batch.createBatchV2(requests);
74
+ batchRequests.push(Batch.createBatchV2(batchId, requests));
75
75
  }
76
76
  else {
77
77
  // Create the batch requests
78
78
  batchRequests.push(Batch.createBatch(batchId, requests));
79
- // End the batch request
80
- batchRequests.push("--" + batchId + "--");
81
79
  }
80
+ // End the batch request
81
+ batchRequests.push("--" + batchId + "--");
82
82
  // Return the target information
83
83
  return new _1.TargetInfo({
84
84
  url: url,
85
85
  endpoint: (isV2 ? "_api/v2.0/" : "") + "$batch",
86
86
  method: "POST",
87
- data: isV2 ? { requests: batchRequests } : batchRequests.join("\r\n"),
87
+ data: batchRequests.join("\r\n"),
88
88
  requestDigest: requestDigest,
89
89
  requestHeader: {
90
- "Content-Type": isV2 ? "application/json" : 'multipart/mixed; boundary="' + batchId + '"'
90
+ "Content-Type": 'multipart/mixed; boundary="' + batchId + '"'
91
91
  }
92
92
  });
93
93
  };
@@ -145,29 +145,49 @@ var Batch = /** @class */ (function () {
145
145
  return request.join("\r\n");
146
146
  };
147
147
  // Method to generate a batch request
148
- Batch.createBatchV2 = function (requests) {
148
+ Batch.createBatchV2 = function (batchId, requests) {
149
149
  var batch = [];
150
150
  // Parse the requests
151
151
  for (var i = 0; i < requests.length; i++) {
152
152
  var request = requests[i];
153
153
  // Create the batch request
154
- var batchRequest = {
155
- id: (i + 1).toString(),
156
- method: request.targetInfo.requestMethod,
157
- url: request.targetInfo.requestUrl
158
- };
159
- // See if a body is set
160
- if (request.targetInfo.requestData) {
161
- batchRequest.body = request.targetInfo.requestData;
162
- batchRequest.headers = {
163
- "Content-Type": "application/json"
164
- };
154
+ batch.push("--" + batchId);
155
+ // Determine if the batch requires a change set
156
+ var requiresChangeset = request && request.targetInfo.requestMethod != "GET";
157
+ if (requiresChangeset) {
158
+ // Create a change set
159
+ batch.push("Content-Type: multipart/mixed; boundary=" + request.changesetId);
160
+ batch.push("");
161
+ batch.push("--" + request.changesetId);
162
+ batch.push("Content-Type: application/http");
163
+ batch.push("Content-Transfer-Encoding: binary");
164
+ batch.push("");
165
+ batch.push(request.targetInfo.requestMethod + " " + request.targetInfo.requestUrl + " HTTP/1.1");
166
+ batch.push("Content-Type: application/json;odata=verbose");
167
+ // See if we are making a delete/update
168
+ if (request.targetInfo.requestMethod == "DELETE" || request.targetInfo.requestMethod == "MERGE") {
169
+ // Append the header for deleting/updating
170
+ batch.push("IF-MATCH: *");
171
+ }
172
+ batch.push("");
173
+ request.targetInfo.requestData ? batch.push(request.targetInfo.requestData) : null;
174
+ batch.push("");
175
+ batch.push("--" + request.changesetId + "--");
176
+ }
177
+ else {
178
+ // Create a change set
179
+ batch.push("Content-Type: application/http");
180
+ batch.push("Content-Transfer-Encoding: binary");
181
+ batch.push("");
182
+ batch.push("GET " + request.targetInfo.requestUrl + " HTTP/1.1");
183
+ batch.push("Accept: application/json");
184
+ batch.push("");
185
+ request.targetInfo.requestData ? batch.push(request.targetInfo.requestData) : null;
186
+ batch.push("");
165
187
  }
166
- // Add the batch request
167
- batch.push(batchRequest);
168
188
  }
169
- // Return the batch requests
170
- return batch;
189
+ // Return the batch request
190
+ return batch.join("\r\n");
171
191
  };
172
192
  // Process the batch request callbacks
173
193
  Batch.processCallbacks = function (batchRequests) {
@@ -32,13 +32,13 @@ declare module 'gd-sprest' {
32
32
  import {
33
33
  Apps, ContextInfo, DirectorySession, Graph, GroupService, GroupSiteManager, HubSites,
34
34
  HubSitesUtility, List, Navigation, PeopleManager, PeoplePicker, ProfileLoader, Search,
35
- Site, SiteIconManager, SiteManager, SitePages, SocialFeed, ThemeManager, UserProfile,
35
+ SensitivityLabels, Site, SiteIconManager, SiteManager, SitePages, SocialFeed, ThemeManager, UserProfile,
36
36
  Utility, Web, WebTemplateExtensions, WorkflowInstanceService, WorkflowSubscriptionService
37
37
  } from "./lib";
38
38
  export {
39
39
  Apps, ContextInfo, DirectorySession, Graph, GroupService, GroupSiteManager, HubSites,
40
40
  HubSitesUtility, List, Navigation, PeopleManager, PeoplePicker, ProfileLoader, Search,
41
- Site, SiteIconManager, SiteManager, SitePages, SocialFeed, ThemeManager, UserProfile,
41
+ SensitivityLabels, Site, SiteIconManager, SiteManager, SitePages, SocialFeed, ThemeManager, UserProfile,
42
42
  Utility, Web, WebTemplateExtensions, WorkflowInstanceService, WorkflowSubscriptionService
43
43
  }
44
44
 
@@ -4046,7 +4046,7 @@ declare module 'gd-sprest/lib/search' {
4046
4046
  }
4047
4047
 
4048
4048
  declare module 'gd-sprest/lib/sensitivityLabels' {
4049
- import { IBaseExecution } from "gd-sprest-def/lib/base";
4049
+ import { IBaseCollection } from "gd-sprest-def/lib/base";
4050
4050
  import { ISensitivityLabelCollection } from "gd-sprest-def/lib/SP/entitytypes";
4051
4051
  import { ITargetInfoProps } from "gd-sprest/utils";
4052
4052
 
@@ -4066,7 +4066,134 @@ declare module 'gd-sprest/lib/sensitivityLabels' {
4066
4066
  * @param url - (Optional) The web url.
4067
4067
  * @param targetInfo - (Optional) The target information.
4068
4068
  */
4069
- (url?: string, targetInfo?: ITargetInfoProps): IBaseExecution<ISensitivityLabelCollection>;
4069
+ (url?: string, targetInfo?: ITargetInfoProps): ISensitivityLabelCollection;
4070
+
4071
+ // Gets the sensitivity labels for this user.
4072
+ getLabelsForUser(): IBaseCollection<ISensitivityLabelResult>;
4073
+ }
4074
+
4075
+ /**
4076
+ * Sensitivity Label Result
4077
+ */
4078
+ export interface ISensitivityLabel {
4079
+ apiLabelVersion: string;
4080
+ applicableTo: string;
4081
+ applicationMode: string;
4082
+ assignedPolicies: [{
4083
+ id: string;
4084
+ name: string;
4085
+ }]
4086
+ autoLabeling: boolean;
4087
+ color: string;
4088
+ customSettings: [{
4089
+ name: string;
4090
+ value: string;
4091
+ }]
4092
+ defaultSubLabelId: string;
4093
+ description: string;
4094
+ displayName: string;
4095
+ id: string;
4096
+ isDefault: boolean;
4097
+ isEnabled: boolean;
4098
+ isEndpointProtectionEnabled: boolean;
4099
+ isParent: boolean;
4100
+ isSmimeEncryptEnabled: boolean;
4101
+ isSmimeSignEnabled: boolean;
4102
+ labelActions: [any];
4103
+ name: string;
4104
+ priority: number;
4105
+ tooltip: string;
4106
+ }
4107
+
4108
+ /**
4109
+ * Sensitivity Label Result
4110
+ */
4111
+ export interface ISensitivityLabelResult extends ISensitivityLabel {
4112
+ defaultContentLabel: string;
4113
+ "defaultContentLabel@data.context": string;
4114
+ sensitivityPolicySettings: {
4115
+ analyticsSettings: {
4116
+ isAuditEnabled: boolean;
4117
+ isLogMatchedContentEnabled: boolean;
4118
+ }
4119
+ applicableTo: string;
4120
+ attachmentActionSettings: {
4121
+ attachmentAction: string;
4122
+ attachmentActionTip: string;
4123
+ }
4124
+ containerSettings: {
4125
+ isSiteAndGroupMandatory: boolean;
4126
+ }
4127
+ customSettings: [any];
4128
+ downgradeSensitivityRequiresJustification: boolean;
4129
+ fileExplorerSettings: {
4130
+ isCustomPermissionsEnabled: boolean;
4131
+ isCustomPermissionsForCustomProtectedFilesEnabled: boolean;
4132
+ }
4133
+ generalSettings: {
4134
+ isContainerSupportEnabled: boolean;
4135
+ isHideBarByDefaultEnabled: boolean;
4136
+ isLabelByEmailHeaderEnabled: boolean;
4137
+ isPostponeMandatoryBeforeSaveEnabled: boolean;
4138
+ isPowerbiMandatory: boolean;
4139
+ isRevokeGuiSupportEnabled: boolean;
4140
+ isRunPolicyInBackgroundEnabled: boolean;
4141
+ isTrackAndRevokeEnabled: boolean;
4142
+ isUseCopyAndPreserveFileSystemOwnerEnabled: boolean;
4143
+ justificationTextForUserText: string;
4144
+ pfileReformatExtensions: string[];
4145
+ pfileSupportedExtensions: string[];
4146
+ reportAnIssueLink: string;
4147
+ }
4148
+ helpWebUrl: string;
4149
+ id: string;
4150
+ inheritanceLabelSettings: {
4151
+ applyLabelToArtifacts: boolean;
4152
+ inheritLabelFromFile: string;
4153
+ }
4154
+ isMandatory: boolean;
4155
+ outlookEmailSettings: {
4156
+ defaultLabel: string;
4157
+ isDistributionListExpansionEnabled: boolean;
4158
+ isMandatoryDisabled: boolean;
4159
+ isRecommendationEnabled: boolean;
4160
+ isSkipSmimeOnReadingPaneEnabled: boolean;
4161
+ outlookGetEmailAddressesTimeOutMSProperty: string;
4162
+ overrideUnlabledCollaborationExtenstions: string[];
4163
+ unlabeledCollaborationActionOverrideMailBodyBehavior: string;
4164
+ }
4165
+ outlookPopupMessageSettings: {
4166
+ blockTrustedDomains: string[];
4167
+ blockUntrustedCollaborationLabels: string[];
4168
+ justifyTrustedDomains: string[];
4169
+ justifyUntrustedCollaborationLabels: string[];
4170
+ warnTrustedDomains: string[];
4171
+ warnUntrustedCollaborationLabels: string[];
4172
+ }
4173
+ performanceSettings: {
4174
+ officeContentExtractionTimeout: number;
4175
+ scannerMaxCPU: number;
4176
+ scannerMaxThreadCount: number;
4177
+ scannerMinCPU: number;
4178
+ sharepointFileWebRequestTimeout: number;
4179
+ sharepointWebRequestTimeout: number;
4180
+ skippedScannerFileSystemAttributes: string[];
4181
+ }
4182
+ powerpointSettings: {
4183
+ isRemoveExternalMarkingFromCustomLayoutsEnabled: boolean;
4184
+ removeAllShapesByShapeName: boolean;
4185
+ shapeNameToRemove: string;
4186
+ }
4187
+ siteAndGroupDefaultLabel: ISensitivityLabel;
4188
+ unifiedPolicySettings: {
4189
+ classificationScheme: string;
4190
+ isLabelCoauthEnabled: boolean;
4191
+ isPurviewLabelConsentAvailable: boolean;
4192
+ }
4193
+ }
4194
+ "sensitivityPolicySettings@data.context": string;
4195
+ sublabels: ISensitivityLabelResult[];
4196
+ "sublabels@data.context": string;
4070
4197
  }
4071
4198
  }
4072
4199