@pnp/cli-microsoft365 6.7.0-beta.2f81b87 → 6.7.0-beta.60f2469
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/csom.json +2 -0
- package/dist/m365/aad/commands/user/user-set.js +145 -30
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +144 -0
- package/dist/m365/spo/commands/list/list-add.js +7 -0
- package/dist/m365/spo/commands/list/list-set.js +7 -0
- package/dist/m365/spo/commands/site/site-recyclebinitem-clear.js +115 -0
- package/dist/m365/spo/commands.js +2 -0
- package/dist/m365/teams/commands/team/team-add.js +2 -2
- package/docs/docs/cmd/aad/user/user-set.md +53 -8
- package/docs/docs/cmd/pp/tenant/tenant-settings-list.md +25 -9
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.md +145 -0
- package/docs/docs/cmd/spo/list/list-add.md +3 -0
- package/docs/docs/cmd/spo/list/list-set.md +3 -0
- package/docs/docs/cmd/spo/site/site-recyclebinitem-clear.md +45 -0
- package/docs/docs/cmd/tenant/id/id-get.md +6 -0
- package/docs/docs/cmd/tenant/report/report-activeusercounts.md +7 -0
- package/docs/docs/cmd/tenant/report/report-activeuserdetail.md +7 -0
- package/docs/docs/cmd/tenant/report/report-office365activationcounts.md +7 -0
- package/docs/docs/cmd/tenant/report/report-office365activationsusercounts.md +7 -0
- package/docs/docs/cmd/tenant/report/report-office365activationsuserdetail.md +7 -0
- package/docs/docs/cmd/tenant/report/report-servicesusercounts.md +7 -0
- package/docs/docs/cmd/tenant/security/security-alerts-list.md +23 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +32 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +32 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.md +26 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.md +26 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.md +22 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.md +22 -0
- package/package.json +2 -1
package/csom.json
CHANGED
|
@@ -176,6 +176,7 @@
|
|
|
176
176
|
"Description": "String",
|
|
177
177
|
"DescriptionResource": "UserResource",
|
|
178
178
|
"Direction": "String",
|
|
179
|
+
"DisableCommenting": "Boolean",
|
|
179
180
|
"DisableGridEditing": "Boolean",
|
|
180
181
|
"DocumentTemplateUrl": "String",
|
|
181
182
|
"DraftVersionVisibility": "DraftVisibilityType",
|
|
@@ -254,6 +255,7 @@
|
|
|
254
255
|
"DefaultNewFormUrl": "String",
|
|
255
256
|
"Description": "String",
|
|
256
257
|
"Direction": "String",
|
|
258
|
+
"DisableCommenting": "Boolean",
|
|
257
259
|
"DisableGridEditing": "Boolean",
|
|
258
260
|
"DocumentTemplateUrl": "String",
|
|
259
261
|
"DraftVersionVisibility": "DraftVisibilityType",
|
|
@@ -44,9 +44,6 @@ class AadUserSetCommand extends GraphCommand_1.default {
|
|
|
44
44
|
commandAction(logger, args) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
try {
|
|
47
|
-
if (this.verbose) {
|
|
48
|
-
logger.logToStderr(`Updating user ${args.options.userPrincipalName || args.options.objectId}`);
|
|
49
|
-
}
|
|
50
47
|
if (args.options.currentPassword) {
|
|
51
48
|
if (args.options.objectId && args.options.objectId !== accessToken_1.accessToken.getUserIdFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken)) {
|
|
52
49
|
throw `You can only change your own password. Please use --objectId @meId to reference to your own userId`;
|
|
@@ -55,11 +52,14 @@ class AadUserSetCommand extends GraphCommand_1.default {
|
|
|
55
52
|
throw 'You can only change your own password. Please use --userPrincipalName @meUserName to reference to your own user principal name';
|
|
56
53
|
}
|
|
57
54
|
}
|
|
55
|
+
if (this.verbose) {
|
|
56
|
+
logger.logToStderr(`Updating user ${args.options.userPrincipalName || args.options.objectId}`);
|
|
57
|
+
}
|
|
58
58
|
const requestUrl = `${this.resource}/v1.0/users/${formatting_1.formatting.encodeQueryParameter(args.options.objectId ? args.options.objectId : args.options.userPrincipalName)}`;
|
|
59
59
|
const manifest = this.mapRequestBody(args.options);
|
|
60
|
-
if (Object.keys(manifest).
|
|
60
|
+
if (Object.keys(manifest).some(k => manifest[k] !== undefined)) {
|
|
61
61
|
if (this.verbose) {
|
|
62
|
-
logger.logToStderr(`Setting the updated properties for
|
|
62
|
+
logger.logToStderr(`Setting the updated properties for user ${args.options.userPrincipalName || args.options.objectId}`);
|
|
63
63
|
}
|
|
64
64
|
const requestOptions = {
|
|
65
65
|
url: requestUrl,
|
|
@@ -74,6 +74,19 @@ class AadUserSetCommand extends GraphCommand_1.default {
|
|
|
74
74
|
if (args.options.currentPassword) {
|
|
75
75
|
yield this.changePassword(requestUrl, args.options, logger);
|
|
76
76
|
}
|
|
77
|
+
if (args.options.managerUserId || args.options.managerUserName) {
|
|
78
|
+
if (this.verbose) {
|
|
79
|
+
logger.logToStderr(`Updating the manager to ${args.options.managerUserId || args.options.managerUserName}`);
|
|
80
|
+
}
|
|
81
|
+
yield this.updateManager(args.options);
|
|
82
|
+
}
|
|
83
|
+
else if (args.options.removeManager) {
|
|
84
|
+
if (this.verbose) {
|
|
85
|
+
logger.logToStderr('Removing the manager');
|
|
86
|
+
}
|
|
87
|
+
const user = args.options.objectId || args.options.userPrincipalName;
|
|
88
|
+
yield this.removeManager(user);
|
|
89
|
+
}
|
|
77
90
|
}
|
|
78
91
|
catch (err) {
|
|
79
92
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -81,35 +94,32 @@ class AadUserSetCommand extends GraphCommand_1.default {
|
|
|
81
94
|
});
|
|
82
95
|
}
|
|
83
96
|
mapRequestBody(options) {
|
|
84
|
-
const requestBody = {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
'forceChangePasswordNextSignIn'
|
|
98
|
-
];
|
|
99
|
-
if (options.accountEnabled !== undefined) {
|
|
100
|
-
requestBody['AccountEnabled'] = options.accountEnabled;
|
|
101
|
-
}
|
|
102
|
-
Object.keys(options).forEach(key => {
|
|
103
|
-
if (excludeOptions.indexOf(key) === -1) {
|
|
104
|
-
requestBody[key] = `${options[key]}`;
|
|
105
|
-
}
|
|
106
|
-
});
|
|
97
|
+
const requestBody = {
|
|
98
|
+
displayName: options.displayName,
|
|
99
|
+
givenName: options.firstName,
|
|
100
|
+
surname: options.lastName,
|
|
101
|
+
usageLocation: options.usageLocation,
|
|
102
|
+
officeLocation: options.officeLocation,
|
|
103
|
+
jobTitle: options.jobTitle,
|
|
104
|
+
companyName: options.companyName,
|
|
105
|
+
department: options.department,
|
|
106
|
+
preferredLanguage: options.preferredLanguage,
|
|
107
|
+
accountEnabled: options.accountEnabled
|
|
108
|
+
};
|
|
109
|
+
this.addUnknownOptionsToPayload(requestBody, options);
|
|
107
110
|
if (options.resetPassword) {
|
|
108
111
|
requestBody.passwordProfile = {
|
|
109
112
|
forceChangePasswordNextSignIn: options.forceChangePasswordNextSignIn || false,
|
|
113
|
+
forceChangePasswordNextSignInWithMfa: options.forceChangePasswordNextSignInWithMfa || false,
|
|
110
114
|
password: options.newPassword
|
|
111
115
|
};
|
|
112
116
|
}
|
|
117
|
+
// Replace every empty string with null
|
|
118
|
+
for (const key in requestBody) {
|
|
119
|
+
if (typeof requestBody[key] === 'string' && requestBody[key].trim() === '') {
|
|
120
|
+
requestBody[key] = null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
113
123
|
return requestBody;
|
|
114
124
|
}
|
|
115
125
|
changePassword(requestUrl, options, logger) {
|
|
@@ -132,6 +142,31 @@ class AadUserSetCommand extends GraphCommand_1.default {
|
|
|
132
142
|
yield request_1.default.post(requestOptions);
|
|
133
143
|
});
|
|
134
144
|
}
|
|
145
|
+
updateManager(options) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const managerRequestOptions = {
|
|
148
|
+
url: `${this.resource}/v1.0/users/${options.objectId || options.userPrincipalName}/manager/$ref`,
|
|
149
|
+
headers: {
|
|
150
|
+
accept: 'application/json;odata.metadata=none'
|
|
151
|
+
},
|
|
152
|
+
data: {
|
|
153
|
+
'@odata.id': `${this.resource}/v1.0/users/${options.managerUserId || options.managerUserName}`
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
yield request_1.default.put(managerRequestOptions);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
removeManager(userId) {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
const managerRequestOptions = {
|
|
162
|
+
url: `${this.resource}/v1.0/users/${userId}/manager/$ref`,
|
|
163
|
+
headers: {
|
|
164
|
+
accept: 'application/json;odata.metadata=none'
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
yield request_1.default.delete(managerRequestOptions);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
135
170
|
}
|
|
136
171
|
_AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry = function _AadUserSetCommand_initTelemetry() {
|
|
137
172
|
this.telemetry.push((args) => {
|
|
@@ -142,7 +177,20 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
|
|
|
142
177
|
resetPassword: !!args.options.resetPassword,
|
|
143
178
|
forceChangePasswordNextSignIn: !!args.options.forceChangePasswordNextSignIn,
|
|
144
179
|
currentPassword: typeof args.options.currentPassword !== 'undefined',
|
|
145
|
-
newPassword: typeof args.options.newPassword !== 'undefined'
|
|
180
|
+
newPassword: typeof args.options.newPassword !== 'undefined',
|
|
181
|
+
displayName: typeof args.options.displayName !== 'undefined',
|
|
182
|
+
firstName: typeof args.options.firstName !== 'undefined',
|
|
183
|
+
lastName: typeof args.options.lastName !== 'undefined',
|
|
184
|
+
forceChangePasswordNextSignInWithMfa: !!args.options.forceChangePasswordNextSignInWithMfa,
|
|
185
|
+
usageLocation: typeof args.options.usageLocation !== 'undefined',
|
|
186
|
+
officeLocation: typeof args.options.officeLocation !== 'undefined',
|
|
187
|
+
jobTitle: typeof args.options.jobTitle !== 'undefined',
|
|
188
|
+
companyName: typeof args.options.companyName !== 'undefined',
|
|
189
|
+
department: typeof args.options.department !== 'undefined',
|
|
190
|
+
preferredLanguage: typeof args.options.preferredLanguage !== 'undefined',
|
|
191
|
+
managerUserId: typeof args.options.managerUserId !== 'undefined',
|
|
192
|
+
managerUserName: typeof args.options.managerUserName !== 'undefined',
|
|
193
|
+
removeManager: typeof args.options.removeManager !== 'undefined'
|
|
146
194
|
});
|
|
147
195
|
});
|
|
148
196
|
}, _AadUserSetCommand_initOptions = function _AadUserSetCommand_initOptions() {
|
|
@@ -161,6 +209,32 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
|
|
|
161
209
|
option: '--currentPassword [currentPassword]'
|
|
162
210
|
}, {
|
|
163
211
|
option: '--newPassword [newPassword]'
|
|
212
|
+
}, {
|
|
213
|
+
option: '--displayName [displayName]'
|
|
214
|
+
}, {
|
|
215
|
+
option: '--firstName [firstName]'
|
|
216
|
+
}, {
|
|
217
|
+
option: '--lastName [lastName]'
|
|
218
|
+
}, {
|
|
219
|
+
option: '--forceChangePasswordNextSignInWithMfa'
|
|
220
|
+
}, {
|
|
221
|
+
option: '--usageLocation [usageLocation]'
|
|
222
|
+
}, {
|
|
223
|
+
option: '--officeLocation [officeLocation]'
|
|
224
|
+
}, {
|
|
225
|
+
option: '--jobTitle [jobTitle]'
|
|
226
|
+
}, {
|
|
227
|
+
option: '--companyName [companyName]'
|
|
228
|
+
}, {
|
|
229
|
+
option: '--department [department]'
|
|
230
|
+
}, {
|
|
231
|
+
option: '--preferredLanguage [preferredLanguage]'
|
|
232
|
+
}, {
|
|
233
|
+
option: '--managerUserId [managerUserId]'
|
|
234
|
+
}, {
|
|
235
|
+
option: '--managerUserName [managerUserName]'
|
|
236
|
+
}, {
|
|
237
|
+
option: '--removeManager'
|
|
164
238
|
});
|
|
165
239
|
}, _AadUserSetCommand_initTypes = function _AadUserSetCommand_initTypes() {
|
|
166
240
|
this.types.boolean.push('accountEnabled');
|
|
@@ -182,10 +256,51 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
|
|
|
182
256
|
if (args.options.resetPassword && !args.options.newPassword) {
|
|
183
257
|
return `When resetting a user's password, specify the new password to set for the user, using the newPassword option`;
|
|
184
258
|
}
|
|
259
|
+
if (args.options.firstName && args.options.firstName.length > 64) {
|
|
260
|
+
return `The max lenght for the firstName option is 64 characters`;
|
|
261
|
+
}
|
|
262
|
+
if (args.options.lastName && args.options.lastName.length > 64) {
|
|
263
|
+
return `The max lenght for the lastName option is 64 characters`;
|
|
264
|
+
}
|
|
265
|
+
if (args.options.forceChangePasswordNextSignIn && !args.options.resetPassword) {
|
|
266
|
+
return `The option forceChangePasswordNextSignIn can only be used in combination with the resetPassword option`;
|
|
267
|
+
}
|
|
268
|
+
if (args.options.forceChangePasswordNextSignInWithMfa && !args.options.resetPassword) {
|
|
269
|
+
return `The option forceChangePasswordNextSignInWithMfa can only be used in combination with the resetPassword option`;
|
|
270
|
+
}
|
|
271
|
+
if (args.options.usageLocation) {
|
|
272
|
+
const regex = new RegExp('^[a-zA-Z]{2}$');
|
|
273
|
+
if (!regex.test(args.options.usageLocation)) {
|
|
274
|
+
return `'${args.options.usageLocation}' is not a valid usageLocation.`;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (args.options.jobTitle && args.options.jobTitle.length > 128) {
|
|
278
|
+
return `The max lenght for the jobTitle option is 128 characters`;
|
|
279
|
+
}
|
|
280
|
+
if (args.options.companyName && args.options.companyName.length > 64) {
|
|
281
|
+
return `The max lenght for the companyName option is 64 characters`;
|
|
282
|
+
}
|
|
283
|
+
if (args.options.department && args.options.department.length > 64) {
|
|
284
|
+
return `The max lenght for the department option is 64 characters`;
|
|
285
|
+
}
|
|
286
|
+
if (args.options.preferredLanguage && args.options.preferredLanguage.length < 2) {
|
|
287
|
+
return `'${args.options.preferredLanguage}' is not a valid preferredLanguage`;
|
|
288
|
+
}
|
|
289
|
+
if (args.options.managerUserName && !validation_1.validation.isValidUserPrincipalName(args.options.managerUserName)) {
|
|
290
|
+
return `'${args.options.managerUserName}' is not a valid user principal name`;
|
|
291
|
+
}
|
|
292
|
+
if (args.options.managerUserId && !validation_1.validation.isValidGuid(args.options.managerUserId)) {
|
|
293
|
+
return `'${args.options.managerUserId}' is not a valid GUID`;
|
|
294
|
+
}
|
|
185
295
|
return true;
|
|
186
296
|
}));
|
|
187
297
|
}, _AadUserSetCommand_initOptionSets = function _AadUserSetCommand_initOptionSets() {
|
|
188
|
-
this.optionSets.push({
|
|
298
|
+
this.optionSets.push({
|
|
299
|
+
options: ['objectId', 'userPrincipalName']
|
|
300
|
+
}, {
|
|
301
|
+
options: ['managerUserId', 'managerUserName', 'removeManager'],
|
|
302
|
+
runsWhen: (args) => args.options.managerUserId || args.options.managerUserName || args.options.removeManager
|
|
303
|
+
});
|
|
189
304
|
};
|
|
190
305
|
module.exports = new AadUserSetCommand();
|
|
191
306
|
//# sourceMappingURL=user-set.js.map
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _SpoApplicationCustomizerGetCommand_instances, _SpoApplicationCustomizerGetCommand_initTelemetry, _SpoApplicationCustomizerGetCommand_initOptions, _SpoApplicationCustomizerGetCommand_initValidators, _SpoApplicationCustomizerGetCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
19
|
+
const spo_1 = require("../../../../utils/spo");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
|
+
const commands_1 = require("../../commands");
|
|
23
|
+
class SpoApplicationCustomizerGetCommand extends SpoCommand_1.default {
|
|
24
|
+
get name() {
|
|
25
|
+
return commands_1.default.APPLICATIONCUSTOMIZER_GET;
|
|
26
|
+
}
|
|
27
|
+
get description() {
|
|
28
|
+
return 'Get an application customizer that is added to a site.';
|
|
29
|
+
}
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
_SpoApplicationCustomizerGetCommand_instances.add(this);
|
|
33
|
+
this.allowedScopes = ['All', 'Site', 'Web'];
|
|
34
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerGetCommand_instances, "m", _SpoApplicationCustomizerGetCommand_initTelemetry).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerGetCommand_instances, "m", _SpoApplicationCustomizerGetCommand_initOptions).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerGetCommand_instances, "m", _SpoApplicationCustomizerGetCommand_initValidators).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerGetCommand_instances, "m", _SpoApplicationCustomizerGetCommand_initOptionSets).call(this);
|
|
38
|
+
}
|
|
39
|
+
commandAction(logger, args) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
try {
|
|
42
|
+
const customAction = yield this.getCustomAction(args.options);
|
|
43
|
+
if (customAction) {
|
|
44
|
+
logger.log({
|
|
45
|
+
ClientSideComponentId: customAction.ClientSideComponentId,
|
|
46
|
+
ClientSideComponentProperties: customAction.ClientSideComponentProperties,
|
|
47
|
+
CommandUIExtension: customAction.CommandUIExtension,
|
|
48
|
+
Description: customAction.Description,
|
|
49
|
+
Group: customAction.Group,
|
|
50
|
+
Id: customAction.Id,
|
|
51
|
+
ImageUrl: customAction.ImageUrl,
|
|
52
|
+
Location: customAction.Location,
|
|
53
|
+
Name: customAction.Name,
|
|
54
|
+
RegistrationId: customAction.RegistrationId,
|
|
55
|
+
RegistrationType: customAction.RegistrationType,
|
|
56
|
+
Rights: JSON.stringify(customAction.Rights),
|
|
57
|
+
Scope: this.humanizeScope(customAction.Scope),
|
|
58
|
+
ScriptBlock: customAction.ScriptBlock,
|
|
59
|
+
ScriptSrc: customAction.ScriptSrc,
|
|
60
|
+
Sequence: customAction.Sequence,
|
|
61
|
+
Title: customAction.Title,
|
|
62
|
+
Url: customAction.Url,
|
|
63
|
+
VersionOfUserCustomAction: customAction.VersionOfUserCustomAction
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
this.handleRejectedPromise(err);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
getCustomAction(options) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
if (options.id) {
|
|
75
|
+
const customAction = yield spo_1.spo.getCustomActionById(options.webUrl, options.id, options.scope);
|
|
76
|
+
if (!customAction || (customAction && customAction.Location !== 'ClientSideExtension.ApplicationCustomizer')) {
|
|
77
|
+
throw `No application customizer with id '${options.id}' found`;
|
|
78
|
+
}
|
|
79
|
+
return customAction;
|
|
80
|
+
}
|
|
81
|
+
const filter = options.title ? `Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}'` : `ClientSideComponentId eq guid'${formatting_1.formatting.encodeQueryParameter(options.clientSideComponentId)}'`;
|
|
82
|
+
const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `${filter} and Location eq 'ClientSideExtension.ApplicationCustomizer'`);
|
|
83
|
+
if (customActions.length === 1) {
|
|
84
|
+
return customActions[0];
|
|
85
|
+
}
|
|
86
|
+
const errorMessage = options.title ? `title '${options.title}'` : `Client Side Component Id '${options.clientSideComponentId}'`;
|
|
87
|
+
if (customActions.length === 0) {
|
|
88
|
+
throw `No application customizer with ${errorMessage} found`;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
throw `Multiple application customizers with ${errorMessage} found. Please disambiguate using IDs: ${customActions.map(a => a.Id).join(', ')}`;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
humanizeScope(scope) {
|
|
96
|
+
switch (scope) {
|
|
97
|
+
case 2:
|
|
98
|
+
return "Site";
|
|
99
|
+
case 3:
|
|
100
|
+
return "Web";
|
|
101
|
+
}
|
|
102
|
+
return `${scope}`;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
_SpoApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoApplicationCustomizerGetCommand_initTelemetry = function _SpoApplicationCustomizerGetCommand_initTelemetry() {
|
|
106
|
+
this.telemetry.push((args) => {
|
|
107
|
+
Object.assign(this.telemetryProperties, {
|
|
108
|
+
title: typeof args.options.title !== 'undefined',
|
|
109
|
+
id: typeof args.options.id !== 'undefined',
|
|
110
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
111
|
+
scope: typeof args.options.scope !== 'undefined'
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
}, _SpoApplicationCustomizerGetCommand_initOptions = function _SpoApplicationCustomizerGetCommand_initOptions() {
|
|
115
|
+
this.options.unshift({
|
|
116
|
+
option: '-u, --webUrl <webUrl>'
|
|
117
|
+
}, {
|
|
118
|
+
option: '-t, --title [title]'
|
|
119
|
+
}, {
|
|
120
|
+
option: '-i, --id [id]'
|
|
121
|
+
}, {
|
|
122
|
+
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
123
|
+
}, {
|
|
124
|
+
option: '-s, --scope [scope]',
|
|
125
|
+
autocomplete: this.allowedScopes
|
|
126
|
+
});
|
|
127
|
+
}, _SpoApplicationCustomizerGetCommand_initValidators = function _SpoApplicationCustomizerGetCommand_initValidators() {
|
|
128
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
130
|
+
return `${args.options.id} is not a valid GUID`;
|
|
131
|
+
}
|
|
132
|
+
if (args.options.clientSideComponentId && !validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
133
|
+
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
134
|
+
}
|
|
135
|
+
if (args.options.scope && this.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
136
|
+
return `'${args.options.scope}' is not a valid application customizer scope. Allowed values are: ${this.allowedScopes.join(',')}`;
|
|
137
|
+
}
|
|
138
|
+
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
139
|
+
}));
|
|
140
|
+
}, _SpoApplicationCustomizerGetCommand_initOptionSets = function _SpoApplicationCustomizerGetCommand_initOptionSets() {
|
|
141
|
+
this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
|
|
142
|
+
};
|
|
143
|
+
module.exports = new SpoApplicationCustomizerGetCommand();
|
|
144
|
+
//# sourceMappingURL=applicationcustomizer-get.js.map
|
|
@@ -144,6 +144,9 @@ class SpoListAddCommand extends SpoCommand_1.default {
|
|
|
144
144
|
if (options.direction) {
|
|
145
145
|
requestBody.Direction = options.direction;
|
|
146
146
|
}
|
|
147
|
+
if (options.disableCommenting !== undefined) {
|
|
148
|
+
requestBody.DisableCommenting = options.disableCommenting;
|
|
149
|
+
}
|
|
147
150
|
if (options.disableGridEditing !== undefined) {
|
|
148
151
|
requestBody.DisableGridEditing = options.disableGridEditing;
|
|
149
152
|
}
|
|
@@ -377,6 +380,9 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
|
|
|
377
380
|
}, {
|
|
378
381
|
option: '--direction [direction]',
|
|
379
382
|
autocomplete: ['NONE', 'LTR', 'RTL']
|
|
383
|
+
}, {
|
|
384
|
+
option: '--disableCommenting [disableCommenting]',
|
|
385
|
+
autocomplete: ['true', 'false']
|
|
380
386
|
}, {
|
|
381
387
|
option: '--disableGridEditing [disableGridEditing]',
|
|
382
388
|
autocomplete: ['true', 'false']
|
|
@@ -585,6 +591,7 @@ SpoListAddCommand.booleanOptions = [
|
|
|
585
591
|
'allowMultiResponses',
|
|
586
592
|
'contentTypesEnabled',
|
|
587
593
|
'crawlNonDefaultViews',
|
|
594
|
+
'disableCommenting',
|
|
588
595
|
'disableGridEditing',
|
|
589
596
|
'enableAssignToEmail',
|
|
590
597
|
'enableAttachments',
|
|
@@ -146,6 +146,9 @@ class SpoListSetCommand extends SpoCommand_1.default {
|
|
|
146
146
|
if (options.direction) {
|
|
147
147
|
requestBody.Direction = options.direction;
|
|
148
148
|
}
|
|
149
|
+
if (options.disableCommenting !== undefined) {
|
|
150
|
+
requestBody.DisableCommenting = options.disableCommenting;
|
|
151
|
+
}
|
|
149
152
|
if (options.disableGridEditing !== undefined) {
|
|
150
153
|
requestBody.DisableGridEditing = options.disableGridEditing;
|
|
151
154
|
}
|
|
@@ -380,6 +383,9 @@ _SpoListSetCommand_instances = new WeakSet(), _SpoListSetCommand_initTelemetry =
|
|
|
380
383
|
}, {
|
|
381
384
|
option: '--direction [direction]',
|
|
382
385
|
autocomplete: ['NONE', 'LTR', 'RTL']
|
|
386
|
+
}, {
|
|
387
|
+
option: '--disableCommenting [disableCommenting]',
|
|
388
|
+
autocomplete: ['true', 'false']
|
|
383
389
|
}, {
|
|
384
390
|
option: '--disableGridEditing [disableGridEditing]',
|
|
385
391
|
autocomplete: ['true', 'false']
|
|
@@ -591,6 +597,7 @@ SpoListSetCommand.booleanOptions = [
|
|
|
591
597
|
'allowMultiResponses',
|
|
592
598
|
'contentTypesEnabled',
|
|
593
599
|
'crawlNonDefaultViews',
|
|
600
|
+
'disableCommenting',
|
|
594
601
|
'disableGridEditing',
|
|
595
602
|
'enableAssignToEmail',
|
|
596
603
|
'enableAttachments',
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _SpoSiteRecycleBinItemClearCommand_instances, _SpoSiteRecycleBinItemClearCommand_initTelemetry, _SpoSiteRecycleBinItemClearCommand_initOptions, _SpoSiteRecycleBinItemClearCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
|
+
const commands_1 = require("../../commands");
|
|
23
|
+
class SpoSiteRecycleBinItemClearCommand extends SpoCommand_1.default {
|
|
24
|
+
get name() {
|
|
25
|
+
return commands_1.default.SITE_RECYCLEBINITEM_CLEAR;
|
|
26
|
+
}
|
|
27
|
+
get description() {
|
|
28
|
+
return 'Permanently removes all items in a site recycle bin';
|
|
29
|
+
}
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
_SpoSiteRecycleBinItemClearCommand_instances.add(this);
|
|
33
|
+
__classPrivateFieldGet(this, _SpoSiteRecycleBinItemClearCommand_instances, "m", _SpoSiteRecycleBinItemClearCommand_initTelemetry).call(this);
|
|
34
|
+
__classPrivateFieldGet(this, _SpoSiteRecycleBinItemClearCommand_instances, "m", _SpoSiteRecycleBinItemClearCommand_initOptions).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _SpoSiteRecycleBinItemClearCommand_instances, "m", _SpoSiteRecycleBinItemClearCommand_initValidators).call(this);
|
|
36
|
+
}
|
|
37
|
+
commandAction(logger, args) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (args.options.confirm) {
|
|
40
|
+
yield this.clearRecycleBin(args, logger);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
const result = yield Cli_1.Cli.prompt({
|
|
44
|
+
type: 'confirm',
|
|
45
|
+
name: 'continue',
|
|
46
|
+
default: false,
|
|
47
|
+
message: `Are you sure you want to clear the recycle bin of site ${args.options.siteUrl}?`
|
|
48
|
+
});
|
|
49
|
+
if (result.continue) {
|
|
50
|
+
yield this.clearRecycleBin(args, logger);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
clearRecycleBin(args, logger) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
try {
|
|
58
|
+
if (this.verbose) {
|
|
59
|
+
logger.logToStderr(`Permanently removing all items in recycle bin of site ${args.options.siteUrl}...`);
|
|
60
|
+
}
|
|
61
|
+
const requestOptions = {
|
|
62
|
+
headers: {
|
|
63
|
+
accept: 'application/json;odata=nometadata'
|
|
64
|
+
},
|
|
65
|
+
responseType: 'json'
|
|
66
|
+
};
|
|
67
|
+
if (args.options.secondary) {
|
|
68
|
+
if (this.verbose) {
|
|
69
|
+
logger.logToStderr('Removing all items from the second-stage recycle bin');
|
|
70
|
+
}
|
|
71
|
+
requestOptions.url = `${args.options.siteUrl}/_api/site/RecycleBin/DeleteAllSecondStageItems`;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
if (this.verbose) {
|
|
75
|
+
logger.logToStderr('Removing all items from the first-stage recycle bin');
|
|
76
|
+
}
|
|
77
|
+
requestOptions.url = `${args.options.siteUrl}/_api/web/RecycleBin/DeleteAll`;
|
|
78
|
+
}
|
|
79
|
+
const result = yield request_1.default.post(requestOptions);
|
|
80
|
+
if (result['odata.null'] !== true) {
|
|
81
|
+
throw result;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
this.handleRejectedODataJsonPromise(err);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
_SpoSiteRecycleBinItemClearCommand_instances = new WeakSet(), _SpoSiteRecycleBinItemClearCommand_initTelemetry = function _SpoSiteRecycleBinItemClearCommand_initTelemetry() {
|
|
91
|
+
this.telemetry.push((args) => {
|
|
92
|
+
Object.assign(this.telemetryProperties, {
|
|
93
|
+
secondary: !!args.options.secondary,
|
|
94
|
+
confirm: !!args.options.confirm
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}, _SpoSiteRecycleBinItemClearCommand_initOptions = function _SpoSiteRecycleBinItemClearCommand_initOptions() {
|
|
98
|
+
this.options.unshift({
|
|
99
|
+
option: '-u, --siteUrl <siteUrl>'
|
|
100
|
+
}, {
|
|
101
|
+
option: '--secondary'
|
|
102
|
+
}, {
|
|
103
|
+
option: '--confirm'
|
|
104
|
+
});
|
|
105
|
+
}, _SpoSiteRecycleBinItemClearCommand_initValidators = function _SpoSiteRecycleBinItemClearCommand_initValidators() {
|
|
106
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.siteUrl);
|
|
108
|
+
if (isValidSharePointUrl !== true) {
|
|
109
|
+
return isValidSharePointUrl;
|
|
110
|
+
}
|
|
111
|
+
return true;
|
|
112
|
+
}));
|
|
113
|
+
};
|
|
114
|
+
module.exports = new SpoSiteRecycleBinItemClearCommand();
|
|
115
|
+
//# sourceMappingURL=site-recyclebinitem-clear.js.map
|
|
@@ -14,6 +14,7 @@ exports.default = {
|
|
|
14
14
|
APP_UNINSTALL: `${prefix} app uninstall`,
|
|
15
15
|
APP_UPGRADE: `${prefix} app upgrade`,
|
|
16
16
|
APPLICATIONCUSTOMIZER_ADD: `${prefix} applicationcustomizer add`,
|
|
17
|
+
APPLICATIONCUSTOMIZER_GET: `${prefix} applicationcustomizer get`,
|
|
17
18
|
APPLICATIONCUSTOMIZER_LIST: `${prefix} applicationcustomizer list`,
|
|
18
19
|
APPPAGE_ADD: `${prefix} apppage add`,
|
|
19
20
|
APPPAGE_SET: `${prefix} apppage set`,
|
|
@@ -246,6 +247,7 @@ exports.default = {
|
|
|
246
247
|
SITE_HUBSITE_THEME_SYNC: `${prefix} site hubsite theme sync`,
|
|
247
248
|
SITE_LIST: `${prefix} site list`,
|
|
248
249
|
SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
|
|
250
|
+
SITE_RECYCLEBINITEM_CLEAR: `${prefix} site recyclebinitem clear`,
|
|
249
251
|
SITE_RECYCLEBINITEM_LIST: `${prefix} site recyclebinitem list`,
|
|
250
252
|
SITE_RECYCLEBINITEM_RESTORE: `${prefix} site recyclebinitem restore`,
|
|
251
253
|
SITE_REMOVE: `${prefix} site remove`,
|
|
@@ -99,7 +99,7 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
|
|
|
99
99
|
}
|
|
100
100
|
}));
|
|
101
101
|
let output;
|
|
102
|
-
if (
|
|
102
|
+
if (!args.options.wait) {
|
|
103
103
|
output = teamsAsyncOperation;
|
|
104
104
|
}
|
|
105
105
|
else {
|
|
@@ -139,7 +139,7 @@ _TeamsTeamAddCommand_instances = new WeakSet(), _TeamsTeamAddCommand_initTelemet
|
|
|
139
139
|
name: typeof args.options.name !== 'undefined',
|
|
140
140
|
description: typeof args.options.description !== 'undefined',
|
|
141
141
|
template: typeof args.options.template !== 'undefined',
|
|
142
|
-
wait: args.options.wait
|
|
142
|
+
wait: !!args.options.wait
|
|
143
143
|
});
|
|
144
144
|
});
|
|
145
145
|
}, _TeamsTeamAddCommand_initOptions = function _TeamsTeamAddCommand_initOptions() {
|