@pnp/cli-microsoft365 4.4.0-beta.ffe290f → 4.4.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.
- package/dist/m365/planner/AppliedCategories.js +3 -0
- package/dist/m365/planner/commands/task/task-set.js +357 -0
- package/dist/m365/planner/commands.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014008_CODE_launch_hostedWorkbench_type.js +62 -0
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.14.0-beta.4.js → upgrade-1.14.0-beta.5.js} +27 -25
- package/dist/m365/spfx/commands/project/project-upgrade.js +1 -1
- package/dist/m365/spo/commands/group/group-user-add.js +64 -13
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +76 -0
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/app/app-list.js +9 -6
- package/dist/m365/teams/commands/chat/chat-message-list.js +60 -0
- package/dist/m365/teams/commands/tab/tab-get.js +9 -6
- package/dist/m365/teams/commands.js +1 -0
- package/docs/docs/cmd/planner/task/task-set.md +99 -0
- package/docs/docs/cmd/spo/group/group-user-add.md +24 -6
- package/docs/docs/cmd/spo/site/site-recyclebinitem-list.md +40 -0
- package/docs/docs/cmd/teams/chat/chat-message-list.md +24 -0
- package/package.json +2 -2
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const Utils_1 = require("../../../../Utils");
|
|
5
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
|
+
const commands_1 = require("../../commands");
|
|
7
|
+
class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.allowedAppliedCategories = ['category1', 'category2', 'category3', 'category4', 'category5', 'category6'];
|
|
11
|
+
}
|
|
12
|
+
get name() {
|
|
13
|
+
return commands_1.default.TASK_SET;
|
|
14
|
+
}
|
|
15
|
+
get description() {
|
|
16
|
+
return 'Updates a Microsoft Planner Task';
|
|
17
|
+
}
|
|
18
|
+
getTelemetryProperties(args) {
|
|
19
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
20
|
+
telemetryProps.title = typeof args.options.title !== 'undefined';
|
|
21
|
+
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
22
|
+
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
23
|
+
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
24
|
+
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
25
|
+
telemetryProps.bucketId = typeof args.options.bucketId !== 'undefined';
|
|
26
|
+
telemetryProps.bucketName = typeof args.options.bucketName !== 'undefined';
|
|
27
|
+
telemetryProps.startDateTime = typeof args.options.startDateTime !== 'undefined';
|
|
28
|
+
telemetryProps.dueDateTime = typeof args.options.dueDateTime !== 'undefined';
|
|
29
|
+
telemetryProps.percentComplete = typeof args.options.percentComplete !== 'undefined';
|
|
30
|
+
telemetryProps.assignedToUserIds = typeof args.options.assignedToUserIds !== 'undefined';
|
|
31
|
+
telemetryProps.assignedToUserNames = typeof args.options.assignedToUserNames !== 'undefined';
|
|
32
|
+
telemetryProps.assigneePriority = typeof args.options.assigneePriority !== 'undefined';
|
|
33
|
+
telemetryProps.description = typeof args.options.description !== 'undefined';
|
|
34
|
+
telemetryProps.appliedCategories = typeof args.options.appliedCategories !== 'undefined';
|
|
35
|
+
telemetryProps.orderHint = typeof args.options.orderHint !== 'undefined';
|
|
36
|
+
return telemetryProps;
|
|
37
|
+
}
|
|
38
|
+
commandAction(logger, args, cb) {
|
|
39
|
+
this
|
|
40
|
+
.getBucketId(args.options)
|
|
41
|
+
.then(bucketId => {
|
|
42
|
+
this.bucketId = bucketId;
|
|
43
|
+
return this.generateUserAssignments(args.options);
|
|
44
|
+
})
|
|
45
|
+
.then(resultAssignments => {
|
|
46
|
+
this.assignments = resultAssignments;
|
|
47
|
+
return this.getTaskEtag(args.options.id);
|
|
48
|
+
})
|
|
49
|
+
.then(etag => {
|
|
50
|
+
const appliedCategories = this.generateAppliedCategories(args.options);
|
|
51
|
+
const data = this.mapRequestBody(args.options, appliedCategories);
|
|
52
|
+
const requestOptions = {
|
|
53
|
+
url: `${this.resource}/v1.0/planner/tasks/${args.options.id}`,
|
|
54
|
+
headers: {
|
|
55
|
+
'accept': 'application/json;odata.metadata=none',
|
|
56
|
+
'If-Match': etag,
|
|
57
|
+
'Prefer': 'return=representation'
|
|
58
|
+
},
|
|
59
|
+
responseType: 'json',
|
|
60
|
+
data: data
|
|
61
|
+
};
|
|
62
|
+
return request_1.default.patch(requestOptions);
|
|
63
|
+
})
|
|
64
|
+
.then(newTask => this.updateTaskDetails(args.options, newTask))
|
|
65
|
+
.then((res) => {
|
|
66
|
+
logger.log(res);
|
|
67
|
+
cb();
|
|
68
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
69
|
+
}
|
|
70
|
+
updateTaskDetails(options, newTask) {
|
|
71
|
+
if (!options.description) {
|
|
72
|
+
return Promise.resolve(newTask);
|
|
73
|
+
}
|
|
74
|
+
const taskId = newTask.id;
|
|
75
|
+
return this
|
|
76
|
+
.getTaskDetailsEtag(taskId)
|
|
77
|
+
.then(etag => {
|
|
78
|
+
const requestOptionsTaskDetails = {
|
|
79
|
+
url: `${this.resource}/v1.0/planner/tasks/${taskId}/details`,
|
|
80
|
+
headers: {
|
|
81
|
+
'accept': 'application/json;odata.metadata=none',
|
|
82
|
+
'If-Match': etag,
|
|
83
|
+
'Prefer': 'return=representation'
|
|
84
|
+
},
|
|
85
|
+
responseType: 'json',
|
|
86
|
+
data: {
|
|
87
|
+
description: options.description
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
return request_1.default.patch(requestOptionsTaskDetails);
|
|
91
|
+
})
|
|
92
|
+
.then(taskDetails => {
|
|
93
|
+
return Object.assign(Object.assign({}, newTask), taskDetails);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
getTaskDetailsEtag(taskId) {
|
|
97
|
+
const requestOptions = {
|
|
98
|
+
url: `${this.resource}/v1.0/planner/tasks/${encodeURIComponent(taskId)}/details`,
|
|
99
|
+
headers: {
|
|
100
|
+
accept: 'application/json'
|
|
101
|
+
},
|
|
102
|
+
responseType: 'json'
|
|
103
|
+
};
|
|
104
|
+
return request_1.default
|
|
105
|
+
.get(requestOptions)
|
|
106
|
+
.then((response) => {
|
|
107
|
+
const etag = response ? response['@odata.etag'] : undefined;
|
|
108
|
+
if (!etag) {
|
|
109
|
+
return Promise.reject(`Error fetching task details`);
|
|
110
|
+
}
|
|
111
|
+
return Promise.resolve(etag);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
getTaskEtag(taskId) {
|
|
115
|
+
const requestOptions = {
|
|
116
|
+
url: `${this.resource}/v1.0/planner/tasks/${encodeURIComponent(taskId)}`,
|
|
117
|
+
headers: {
|
|
118
|
+
accept: 'application/json'
|
|
119
|
+
},
|
|
120
|
+
responseType: 'json'
|
|
121
|
+
};
|
|
122
|
+
return request_1.default
|
|
123
|
+
.get(requestOptions)
|
|
124
|
+
.then((response) => {
|
|
125
|
+
const etag = response ? response['@odata.etag'] : undefined;
|
|
126
|
+
if (!etag) {
|
|
127
|
+
return Promise.reject(`Error fetching task`);
|
|
128
|
+
}
|
|
129
|
+
return Promise.resolve(etag);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
generateAppliedCategories(options) {
|
|
133
|
+
if (!options.appliedCategories) {
|
|
134
|
+
return {};
|
|
135
|
+
}
|
|
136
|
+
const categories = {};
|
|
137
|
+
options.appliedCategories.toLocaleLowerCase().split(',').forEach(x => categories[x] = true);
|
|
138
|
+
return categories;
|
|
139
|
+
}
|
|
140
|
+
generateUserAssignments(options) {
|
|
141
|
+
const assignments = {};
|
|
142
|
+
if (!options.assignedToUserIds && !options.assignedToUserNames) {
|
|
143
|
+
return Promise.resolve(assignments);
|
|
144
|
+
}
|
|
145
|
+
return this
|
|
146
|
+
.getUserIds(options)
|
|
147
|
+
.then((userIds) => {
|
|
148
|
+
userIds.forEach(x => assignments[x] = {
|
|
149
|
+
'@odata.type': '#microsoft.graph.plannerAssignment',
|
|
150
|
+
orderHint: ' !'
|
|
151
|
+
});
|
|
152
|
+
return Promise.resolve(assignments);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
getUserIds(options) {
|
|
156
|
+
if (options.assignedToUserIds) {
|
|
157
|
+
return Promise.resolve(options.assignedToUserIds.split(',').map(o => o.trim()));
|
|
158
|
+
}
|
|
159
|
+
// Hitting this section means assignedToUserNames won't be undefined
|
|
160
|
+
const userNames = options.assignedToUserNames;
|
|
161
|
+
const userArr = userNames.split(',').map(o => o.trim());
|
|
162
|
+
let userIds = [];
|
|
163
|
+
const promises = userArr.map(user => {
|
|
164
|
+
const requestOptions = {
|
|
165
|
+
url: `${this.resource}/v1.0/users?$filter=userPrincipalName eq '${Utils_1.default.encodeQueryParameter(user)}'&$select=id,userPrincipalName`,
|
|
166
|
+
headers: {
|
|
167
|
+
'accept ': 'application/json;odata.metadata=none'
|
|
168
|
+
},
|
|
169
|
+
responseType: 'json'
|
|
170
|
+
};
|
|
171
|
+
return request_1.default.get(requestOptions);
|
|
172
|
+
});
|
|
173
|
+
return Promise
|
|
174
|
+
.all(promises)
|
|
175
|
+
.then((usersRes) => {
|
|
176
|
+
let userUpns = [];
|
|
177
|
+
userUpns = usersRes.map(res => { var _a; return (_a = res.value[0]) === null || _a === void 0 ? void 0 : _a.userPrincipalName; });
|
|
178
|
+
userIds = usersRes.map(res => { var _a; return (_a = res.value[0]) === null || _a === void 0 ? void 0 : _a.id; });
|
|
179
|
+
// Find the members where no graph response was found
|
|
180
|
+
const invalidUsers = userArr.filter(user => !userUpns.some((upn) => (upn === null || upn === void 0 ? void 0 : upn.toLowerCase()) === user.toLowerCase()));
|
|
181
|
+
if (invalidUsers && invalidUsers.length > 0) {
|
|
182
|
+
return Promise.reject(`Cannot proceed with planner task update. The following users provided are invalid : ${invalidUsers.join(',')}`);
|
|
183
|
+
}
|
|
184
|
+
return Promise.resolve(userIds);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
getBucketId(options) {
|
|
188
|
+
if (options.bucketId) {
|
|
189
|
+
return Promise.resolve(options.bucketId);
|
|
190
|
+
}
|
|
191
|
+
if (!options.bucketName) {
|
|
192
|
+
return Promise.resolve(undefined);
|
|
193
|
+
}
|
|
194
|
+
return this
|
|
195
|
+
.getPlanId(options)
|
|
196
|
+
.then(planId => {
|
|
197
|
+
const requestOptions = {
|
|
198
|
+
url: `${this.resource}/v1.0/planner/plans/${planId}/buckets?$select=id,name`,
|
|
199
|
+
headers: {
|
|
200
|
+
accept: 'application/json;odata.metadata=none'
|
|
201
|
+
},
|
|
202
|
+
responseType: 'json'
|
|
203
|
+
};
|
|
204
|
+
return request_1.default.get(requestOptions);
|
|
205
|
+
})
|
|
206
|
+
.then((response) => {
|
|
207
|
+
const bucket = response.value.find(val => val.name === options.bucketName);
|
|
208
|
+
if (!bucket) {
|
|
209
|
+
return Promise.reject(`The specified bucket does not exist`);
|
|
210
|
+
}
|
|
211
|
+
return Promise.resolve(bucket.id);
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
getPlanId(options) {
|
|
215
|
+
if (options.planId) {
|
|
216
|
+
return Promise.resolve(options.planId);
|
|
217
|
+
}
|
|
218
|
+
return this
|
|
219
|
+
.getGroupId(options)
|
|
220
|
+
.then((groupId) => {
|
|
221
|
+
const requestOptions = {
|
|
222
|
+
url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')&$select=id,title`,
|
|
223
|
+
headers: {
|
|
224
|
+
accept: 'application/json;odata.metadata=none'
|
|
225
|
+
},
|
|
226
|
+
responseType: 'json'
|
|
227
|
+
};
|
|
228
|
+
return request_1.default.get(requestOptions);
|
|
229
|
+
})
|
|
230
|
+
.then((response) => {
|
|
231
|
+
const plan = response.value.find(val => val.title === options.planName);
|
|
232
|
+
if (!plan) {
|
|
233
|
+
return Promise.reject(`The specified plan does not exist`);
|
|
234
|
+
}
|
|
235
|
+
return Promise.resolve(plan.id);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
getGroupId(options) {
|
|
239
|
+
if (options.ownerGroupId) {
|
|
240
|
+
return Promise.resolve(options.ownerGroupId);
|
|
241
|
+
}
|
|
242
|
+
const requestOptions = {
|
|
243
|
+
url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(options.ownerGroupName)}'&$select=id`,
|
|
244
|
+
headers: {
|
|
245
|
+
accept: 'application/json;odata.metadata=none'
|
|
246
|
+
},
|
|
247
|
+
responseType: 'json'
|
|
248
|
+
};
|
|
249
|
+
return request_1.default
|
|
250
|
+
.get(requestOptions)
|
|
251
|
+
.then(response => {
|
|
252
|
+
const group = response.value[0];
|
|
253
|
+
if (!group) {
|
|
254
|
+
return Promise.reject(`The specified owner group does not exist`);
|
|
255
|
+
}
|
|
256
|
+
return Promise.resolve(group.id);
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
mapRequestBody(options, appliedCategories) {
|
|
260
|
+
const requestBody = {};
|
|
261
|
+
if (options.title) {
|
|
262
|
+
requestBody.title = options.title;
|
|
263
|
+
}
|
|
264
|
+
if (this.bucketId) {
|
|
265
|
+
requestBody.bucketId = this.bucketId;
|
|
266
|
+
}
|
|
267
|
+
if (options.startDateTime) {
|
|
268
|
+
requestBody.startDateTime = options.startDateTime;
|
|
269
|
+
}
|
|
270
|
+
if (options.dueDateTime) {
|
|
271
|
+
requestBody.dueDateTime = options.dueDateTime;
|
|
272
|
+
}
|
|
273
|
+
if (options.percentComplete) {
|
|
274
|
+
requestBody.percentComplete = options.percentComplete;
|
|
275
|
+
}
|
|
276
|
+
if (this.assignments && Object.keys(this.assignments).length > 0) {
|
|
277
|
+
requestBody.assignments = this.assignments;
|
|
278
|
+
}
|
|
279
|
+
if (options.assigneePriority) {
|
|
280
|
+
requestBody.assigneePriority = options.assigneePriority;
|
|
281
|
+
}
|
|
282
|
+
if (appliedCategories && Object.keys(appliedCategories).length > 0) {
|
|
283
|
+
requestBody.appliedCategories = appliedCategories;
|
|
284
|
+
}
|
|
285
|
+
if (options.orderHint) {
|
|
286
|
+
requestBody.orderHint = options.orderHint;
|
|
287
|
+
}
|
|
288
|
+
return requestBody;
|
|
289
|
+
}
|
|
290
|
+
options() {
|
|
291
|
+
const options = [
|
|
292
|
+
{ option: '-i, --id <id>' },
|
|
293
|
+
{ option: '-t, --title [title]' },
|
|
294
|
+
{ option: '--planId [planId]' },
|
|
295
|
+
{ option: '--planName [planName]' },
|
|
296
|
+
{ option: '--ownerGroupId [ownerGroupId]' },
|
|
297
|
+
{ option: '--ownerGroupName [ownerGroupName]' },
|
|
298
|
+
{ option: '--bucketId [bucketId]' },
|
|
299
|
+
{ option: '--bucketName [bucketName]' },
|
|
300
|
+
{ option: '--startDateTime [startDateTime]' },
|
|
301
|
+
{ option: '--dueDateTime [dueDateTime]' },
|
|
302
|
+
{ option: '--percentComplete [percentComplete]' },
|
|
303
|
+
{ option: '--assignedToUserIds [assignedToUserIds]' },
|
|
304
|
+
{ option: '--assignedToUserNames [assignedToUserNames]' },
|
|
305
|
+
{ option: '--assigneePriority [assigneePriority]' },
|
|
306
|
+
{ option: '--description [description]' },
|
|
307
|
+
{ option: '--appliedCategories [appliedCategories]' },
|
|
308
|
+
{ option: '--orderHint [orderHint]' }
|
|
309
|
+
];
|
|
310
|
+
const parentOptions = super.options();
|
|
311
|
+
return options.concat(parentOptions);
|
|
312
|
+
}
|
|
313
|
+
validate(args) {
|
|
314
|
+
if (args.options.bucketId && args.options.bucketName) {
|
|
315
|
+
return 'Specify either bucketId or bucketName but not both';
|
|
316
|
+
}
|
|
317
|
+
if (args.options.bucketName && !args.options.planId && !args.options.planName) {
|
|
318
|
+
return 'Specify either planId or planName when using bucketName';
|
|
319
|
+
}
|
|
320
|
+
if (args.options.bucketName && args.options.planId && args.options.planName) {
|
|
321
|
+
return 'Specify either planId or planName when using bucketName but not both';
|
|
322
|
+
}
|
|
323
|
+
if (args.options.planName && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
324
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planName';
|
|
325
|
+
}
|
|
326
|
+
if (args.options.planName && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
327
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planName but not both';
|
|
328
|
+
}
|
|
329
|
+
if (args.options.ownerGroupId && !Utils_1.default.isValidGuid(args.options.ownerGroupId)) {
|
|
330
|
+
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
331
|
+
}
|
|
332
|
+
if (args.options.startDateTime && !Utils_1.default.isValidISODateTime(args.options.startDateTime)) {
|
|
333
|
+
return 'The startDateTime is not a valid ISO date string';
|
|
334
|
+
}
|
|
335
|
+
if (args.options.dueDateTime && !Utils_1.default.isValidISODateTime(args.options.dueDateTime)) {
|
|
336
|
+
return 'The dueDateTime is not a valid ISO date string';
|
|
337
|
+
}
|
|
338
|
+
if (args.options.percentComplete && isNaN(args.options.percentComplete)) {
|
|
339
|
+
return `percentComplete is not a number`;
|
|
340
|
+
}
|
|
341
|
+
if (args.options.percentComplete && (args.options.percentComplete < 0 || args.options.percentComplete > 100)) {
|
|
342
|
+
return `percentComplete should be between 0 and 100`;
|
|
343
|
+
}
|
|
344
|
+
if (args.options.assignedToUserIds && !Utils_1.default.isValidGuidArray(args.options.assignedToUserIds.split(','))) {
|
|
345
|
+
return 'assignedToUserIds contains invalid GUID';
|
|
346
|
+
}
|
|
347
|
+
if (args.options.assignedToUserIds && args.options.assignedToUserNames) {
|
|
348
|
+
return 'Specify either assignedToUserIds or assignedToUserNames but not both';
|
|
349
|
+
}
|
|
350
|
+
if (args.options.appliedCategories && args.options.appliedCategories.split(',').filter(category => this.allowedAppliedCategories.indexOf(category.toLocaleLowerCase()) < 0).length !== 0) {
|
|
351
|
+
return 'The appliedCategories contains invalid value. Specify either category1, category2, category3, category4, category5 and/or category6 as properties';
|
|
352
|
+
}
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
module.exports = new PlannerTaskSetCommand();
|
|
357
|
+
//# sourceMappingURL=task-set.js.map
|
|
@@ -8,6 +8,7 @@ exports.default = {
|
|
|
8
8
|
PLAN_GET: `${prefix} plan get`,
|
|
9
9
|
PLAN_LIST: `${prefix} plan list`,
|
|
10
10
|
TASK_ADD: `${prefix} task add`,
|
|
11
|
-
TASK_LIST: `${prefix} task list
|
|
11
|
+
TASK_LIST: `${prefix} task list`,
|
|
12
|
+
TASK_SET: `${prefix} task set`
|
|
12
13
|
};
|
|
13
14
|
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FN014008_CODE_launch_hostedWorkbench_type = void 0;
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const JsonRule_1 = require("./JsonRule");
|
|
6
|
+
class FN014008_CODE_launch_hostedWorkbench_type extends JsonRule_1.JsonRule {
|
|
7
|
+
constructor(type) {
|
|
8
|
+
super();
|
|
9
|
+
this.type = type;
|
|
10
|
+
}
|
|
11
|
+
get id() {
|
|
12
|
+
return 'FN014008';
|
|
13
|
+
}
|
|
14
|
+
get title() {
|
|
15
|
+
return 'Hosted workbench type in .vscode/launch.json';
|
|
16
|
+
}
|
|
17
|
+
get description() {
|
|
18
|
+
return `In the .vscode/launch.json file, update the type property for the hosted workbench launch configuration`;
|
|
19
|
+
}
|
|
20
|
+
get resolution() {
|
|
21
|
+
return `{
|
|
22
|
+
"configurations": [
|
|
23
|
+
{
|
|
24
|
+
"type": "${this.type}"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}`;
|
|
28
|
+
}
|
|
29
|
+
get resolutionType() {
|
|
30
|
+
return 'json';
|
|
31
|
+
}
|
|
32
|
+
get severity() {
|
|
33
|
+
return 'Recommended';
|
|
34
|
+
}
|
|
35
|
+
get file() {
|
|
36
|
+
return '.vscode/launch.json';
|
|
37
|
+
}
|
|
38
|
+
visit(project, findings) {
|
|
39
|
+
if (!project.vsCode ||
|
|
40
|
+
!project.vsCode.launchJson ||
|
|
41
|
+
!project.vsCode.launchJson.configurations) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const occurrences = [];
|
|
45
|
+
project.vsCode.launchJson.configurations.forEach((configuration, i) => {
|
|
46
|
+
if (configuration.name === 'Hosted workbench' &&
|
|
47
|
+
configuration.type !== this.type) {
|
|
48
|
+
const node = this.getAstNodeFromFile(project.vsCode.launchJson, `configurations[${i}].url`);
|
|
49
|
+
occurrences.push({
|
|
50
|
+
file: path.relative(project.path, this.file),
|
|
51
|
+
resolution: this.resolution,
|
|
52
|
+
position: this.getPositionFromNode(node)
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
if (occurrences.length > 0) {
|
|
57
|
+
this.addFindingWithOccurrences(occurrences, findings);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.FN014008_CODE_launch_hostedWorkbench_type = FN014008_CODE_launch_hostedWorkbench_type;
|
|
62
|
+
//# sourceMappingURL=FN014008_CODE_launch_hostedWorkbench_type.js.map
|
|
@@ -26,32 +26,34 @@ const FN006004_CFG_PS_developer_1 = require("./rules/FN006004_CFG_PS_developer")
|
|
|
26
26
|
const FN006005_CFG_PS_metadata_1 = require("./rules/FN006005_CFG_PS_metadata");
|
|
27
27
|
const FN006006_CFG_PS_features_1 = require("./rules/FN006006_CFG_PS_features");
|
|
28
28
|
const FN010001_YORC_version_1 = require("./rules/FN010001_YORC_version");
|
|
29
|
+
const FN014008_CODE_launch_hostedWorkbench_type_1 = require("./rules/FN014008_CODE_launch_hostedWorkbench_type");
|
|
29
30
|
module.exports = [
|
|
30
|
-
new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.14.0-beta.
|
|
31
|
-
new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.14.0-beta.
|
|
32
|
-
new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.14.0-beta.
|
|
33
|
-
new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.14.0-beta.
|
|
34
|
-
new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.14.0-beta.
|
|
35
|
-
new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.14.0-beta.
|
|
36
|
-
new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.14.0-beta.
|
|
37
|
-
new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.14.0-beta.
|
|
38
|
-
new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.14.0-beta.
|
|
39
|
-
new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.14.0-beta.
|
|
40
|
-
new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.14.0-beta.
|
|
41
|
-
new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.14.0-beta.
|
|
42
|
-
new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.14.0-beta.
|
|
43
|
-
new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.14.0-beta.
|
|
44
|
-
new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.14.0-beta.
|
|
45
|
-
new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.14.0-beta.
|
|
46
|
-
new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.14.0-beta.
|
|
47
|
-
new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.14.0-beta.
|
|
48
|
-
new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.14.0-beta.
|
|
49
|
-
new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.14.0-beta.
|
|
50
|
-
new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.14.0-beta.
|
|
51
|
-
new FN002009_DEVDEP_microsoft_sp_tslint_rules_1.FN002009_DEVDEP_microsoft_sp_tslint_rules('1.14.0-beta.
|
|
52
|
-
new FN006004_CFG_PS_developer_1.FN006004_CFG_PS_developer('1.14.0-beta.
|
|
31
|
+
new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.14.0-beta.5'),
|
|
32
|
+
new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.14.0-beta.5'),
|
|
33
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.14.0-beta.5'),
|
|
34
|
+
new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.14.0-beta.5'),
|
|
35
|
+
new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.14.0-beta.5'),
|
|
36
|
+
new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.14.0-beta.5'),
|
|
37
|
+
new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.14.0-beta.5'),
|
|
38
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.14.0-beta.5'),
|
|
39
|
+
new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.14.0-beta.5'),
|
|
40
|
+
new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.14.0-beta.5'),
|
|
41
|
+
new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.14.0-beta.5'),
|
|
42
|
+
new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.14.0-beta.5'),
|
|
43
|
+
new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.14.0-beta.5'),
|
|
44
|
+
new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.14.0-beta.5'),
|
|
45
|
+
new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.14.0-beta.5'),
|
|
46
|
+
new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.14.0-beta.5'),
|
|
47
|
+
new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.14.0-beta.5'),
|
|
48
|
+
new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.14.0-beta.5'),
|
|
49
|
+
new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.14.0-beta.5'),
|
|
50
|
+
new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.14.0-beta.5'),
|
|
51
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.14.0-beta.5'),
|
|
52
|
+
new FN002009_DEVDEP_microsoft_sp_tslint_rules_1.FN002009_DEVDEP_microsoft_sp_tslint_rules('1.14.0-beta.5'),
|
|
53
|
+
new FN006004_CFG_PS_developer_1.FN006004_CFG_PS_developer('1.14.0-beta.5'),
|
|
53
54
|
new FN006005_CFG_PS_metadata_1.FN006005_CFG_PS_metadata(),
|
|
54
55
|
new FN006006_CFG_PS_features_1.FN006006_CFG_PS_features(),
|
|
55
|
-
new FN010001_YORC_version_1.FN010001_YORC_version('1.14.0-beta.
|
|
56
|
+
new FN010001_YORC_version_1.FN010001_YORC_version('1.14.0-beta.5'),
|
|
57
|
+
new FN014008_CODE_launch_hostedWorkbench_type_1.FN014008_CODE_launch_hostedWorkbench_type('pwa-chrome')
|
|
56
58
|
];
|
|
57
|
-
//# sourceMappingURL=upgrade-1.14.0-beta.
|
|
59
|
+
//# sourceMappingURL=upgrade-1.14.0-beta.5.js.map
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const cli_1 = require("../../../../cli");
|
|
4
4
|
const Command_1 = require("../../../../Command");
|
|
5
5
|
const request_1 = require("../../../../request");
|
|
6
|
-
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
7
6
|
const AadUserGetCommand = require("../../../aad/commands/user/user-get");
|
|
7
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
8
8
|
const commands_1 = require("../../commands");
|
|
9
9
|
class SpoGroupUserAddCommand extends SpoCommand_1.default {
|
|
10
10
|
get name() {
|
|
@@ -17,15 +17,21 @@ class SpoGroupUserAddCommand extends SpoCommand_1.default {
|
|
|
17
17
|
return ['DisplayName', 'Email'];
|
|
18
18
|
}
|
|
19
19
|
commandAction(logger, args, cb) {
|
|
20
|
-
|
|
20
|
+
let groupId = 0;
|
|
21
|
+
this
|
|
22
|
+
.getGroupId(args)
|
|
23
|
+
.then((_groupId) => {
|
|
24
|
+
groupId = _groupId;
|
|
25
|
+
return this.getOnlyActiveUsers(args, logger);
|
|
26
|
+
})
|
|
21
27
|
.then((resolvedUsernameList) => {
|
|
22
28
|
if (this.verbose) {
|
|
23
|
-
logger.logToStderr(`Start adding Active user/s to SharePoint Group ${args.options.groupId}
|
|
29
|
+
logger.logToStderr(`Start adding Active user/s to SharePoint Group ${args.options.groupId ? args.options.groupId : args.options.groupName}`);
|
|
24
30
|
}
|
|
25
31
|
const data = {
|
|
26
32
|
url: args.options.webUrl,
|
|
27
33
|
peoplePickerInput: this.getFormattedUserList(resolvedUsernameList),
|
|
28
|
-
roleValue: `group:${
|
|
34
|
+
roleValue: `group:${groupId}`
|
|
29
35
|
};
|
|
30
36
|
const requestOptions = {
|
|
31
37
|
url: `${args.options.webUrl}/_api/SP.Web.ShareObject`,
|
|
@@ -46,24 +52,51 @@ class SpoGroupUserAddCommand extends SpoCommand_1.default {
|
|
|
46
52
|
cb();
|
|
47
53
|
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
48
54
|
}
|
|
55
|
+
getGroupId(args) {
|
|
56
|
+
const getGroupMethod = args.options.groupName ?
|
|
57
|
+
`GetByName('${encodeURIComponent(args.options.groupName)}')` :
|
|
58
|
+
`GetById('${args.options.groupId}')`;
|
|
59
|
+
const requestOptions = {
|
|
60
|
+
url: `${args.options.webUrl}/_api/web/sitegroups/${getGroupMethod}`,
|
|
61
|
+
headers: {
|
|
62
|
+
'accept': 'application/json;odata=nometadata'
|
|
63
|
+
},
|
|
64
|
+
responseType: 'json'
|
|
65
|
+
};
|
|
66
|
+
return request_1.default
|
|
67
|
+
.get(requestOptions)
|
|
68
|
+
.then(response => {
|
|
69
|
+
const groupId = response.Id;
|
|
70
|
+
if (!groupId) {
|
|
71
|
+
return Promise.reject(`The specified group does not exist in the SharePoint site`);
|
|
72
|
+
}
|
|
73
|
+
return groupId;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
49
76
|
getOnlyActiveUsers(args, logger) {
|
|
50
77
|
if (this.verbose) {
|
|
51
78
|
logger.logToStderr(`Removing Users which are not active from the original list`);
|
|
52
79
|
}
|
|
53
|
-
const
|
|
54
|
-
|
|
80
|
+
const activeUserNameList = [];
|
|
81
|
+
const userInfo = args.options.userName ? args.options.userName : args.options.email;
|
|
82
|
+
return Promise.all(userInfo.split(',').map(singleUserName => {
|
|
55
83
|
const options = {
|
|
56
|
-
userName: singleUsername.trim(),
|
|
57
84
|
output: 'json',
|
|
58
85
|
debug: args.options.debug,
|
|
59
86
|
verbose: args.options.verbose
|
|
60
87
|
};
|
|
88
|
+
if (args.options.userName) {
|
|
89
|
+
options.userName = singleUserName.trim();
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
options.email = singleUserName.trim();
|
|
93
|
+
}
|
|
61
94
|
return cli_1.Cli.executeCommandWithOutput(AadUserGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) })
|
|
62
95
|
.then((getUserGetOutput) => {
|
|
63
96
|
if (this.debug) {
|
|
64
97
|
logger.logToStderr(getUserGetOutput.stderr);
|
|
65
98
|
}
|
|
66
|
-
|
|
99
|
+
activeUserNameList.push(JSON.parse(getUserGetOutput.stdout).userPrincipalName);
|
|
67
100
|
}, (err) => {
|
|
68
101
|
if (this.debug) {
|
|
69
102
|
logger.logToStderr(err.stderr);
|
|
@@ -71,7 +104,7 @@ class SpoGroupUserAddCommand extends SpoCommand_1.default {
|
|
|
71
104
|
});
|
|
72
105
|
}))
|
|
73
106
|
.then(() => {
|
|
74
|
-
return Promise.resolve(
|
|
107
|
+
return Promise.resolve(activeUserNameList);
|
|
75
108
|
});
|
|
76
109
|
}
|
|
77
110
|
getFormattedUserList(activeUserList) {
|
|
@@ -86,10 +119,16 @@ class SpoGroupUserAddCommand extends SpoCommand_1.default {
|
|
|
86
119
|
option: '-u, --webUrl <webUrl>'
|
|
87
120
|
},
|
|
88
121
|
{
|
|
89
|
-
option: '--groupId
|
|
122
|
+
option: '--groupId [groupId]'
|
|
90
123
|
},
|
|
91
124
|
{
|
|
92
|
-
option: '--
|
|
125
|
+
option: '--groupName [groupName]'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
option: '--userName [userName]'
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
option: '--email [email]'
|
|
93
132
|
}
|
|
94
133
|
];
|
|
95
134
|
const parentOptions = super.options();
|
|
@@ -100,8 +139,20 @@ class SpoGroupUserAddCommand extends SpoCommand_1.default {
|
|
|
100
139
|
if (isValidSharePointUrl !== true) {
|
|
101
140
|
return isValidSharePointUrl;
|
|
102
141
|
}
|
|
103
|
-
if (
|
|
104
|
-
return
|
|
142
|
+
if (!args.options.groupId && !args.options.groupName) {
|
|
143
|
+
return 'Specify either groupId or groupName';
|
|
144
|
+
}
|
|
145
|
+
if (args.options.groupId && args.options.groupName) {
|
|
146
|
+
return 'Specify either groupId or groupName but not both';
|
|
147
|
+
}
|
|
148
|
+
if (!args.options.userName && !args.options.email) {
|
|
149
|
+
return 'Specify either userName or email';
|
|
150
|
+
}
|
|
151
|
+
if (args.options.userName && args.options.email) {
|
|
152
|
+
return 'Specify either userName or email but not both';
|
|
153
|
+
}
|
|
154
|
+
if (args.options.groupId && isNaN(args.options.groupId)) {
|
|
155
|
+
return `Specified groupId ${args.options.groupId} is not a number`;
|
|
105
156
|
}
|
|
106
157
|
return true;
|
|
107
158
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class SpoSiteRecycleBinItemListCommand extends SpoCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.SITE_RECYCLEBINITEM_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Lists items from recycle bin';
|
|
12
|
+
}
|
|
13
|
+
defaultProperties() {
|
|
14
|
+
return ['Id', 'Title', 'DirName'];
|
|
15
|
+
}
|
|
16
|
+
commandAction(logger, args, cb) {
|
|
17
|
+
if (this.verbose) {
|
|
18
|
+
logger.logToStderr(`Retrieving all items from recycle bin at ${args.options.siteUrl}...`);
|
|
19
|
+
}
|
|
20
|
+
const state = args.options.secondary ? '2' : '1';
|
|
21
|
+
let requestUrl = `${args.options.siteUrl}/_api/site/RecycleBin?$filter=(ItemState eq ${state})`;
|
|
22
|
+
if (typeof args.options.type !== 'undefined') {
|
|
23
|
+
const type = SpoSiteRecycleBinItemListCommand.recycleBinItemType.find(item => item.value === args.options.type);
|
|
24
|
+
if (typeof type !== 'undefined') {
|
|
25
|
+
requestUrl += ` and (ItemType eq ${type.id})`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const requestOptions = {
|
|
29
|
+
url: requestUrl,
|
|
30
|
+
headers: {
|
|
31
|
+
'accept': 'application/json;odata=nometadata'
|
|
32
|
+
},
|
|
33
|
+
responseType: 'json'
|
|
34
|
+
};
|
|
35
|
+
request_1.default
|
|
36
|
+
.get(requestOptions)
|
|
37
|
+
.then((response) => {
|
|
38
|
+
logger.log(response.value);
|
|
39
|
+
cb();
|
|
40
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
41
|
+
}
|
|
42
|
+
options() {
|
|
43
|
+
const options = [
|
|
44
|
+
{
|
|
45
|
+
option: '-u, --siteUrl <siteUrl>'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
option: '-t, --type [type]',
|
|
49
|
+
autocomplete: SpoSiteRecycleBinItemListCommand.recycleBinItemType.map(item => item.value)
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
option: '-s, --secondary'
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
const parentOptions = super.options();
|
|
56
|
+
return options.concat(parentOptions);
|
|
57
|
+
}
|
|
58
|
+
validate(args) {
|
|
59
|
+
const isValidSharePointUrl = SpoCommand_1.default.isValidSharePointUrl(args.options.siteUrl);
|
|
60
|
+
if (isValidSharePointUrl !== true) {
|
|
61
|
+
return isValidSharePointUrl;
|
|
62
|
+
}
|
|
63
|
+
if (typeof args.options.type !== 'undefined' &&
|
|
64
|
+
!SpoSiteRecycleBinItemListCommand.recycleBinItemType.some(item => item.value === args.options.type)) {
|
|
65
|
+
return `${args.options.type} is not a valid value. Allowed values are ${SpoSiteRecycleBinItemListCommand.recycleBinItemType.map(item => item.value).join(', ')}`;
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
SpoSiteRecycleBinItemListCommand.recycleBinItemType = [
|
|
71
|
+
{ id: 1, value: 'files' },
|
|
72
|
+
{ id: 3, value: 'listItems' },
|
|
73
|
+
{ id: 5, value: 'folders' }
|
|
74
|
+
];
|
|
75
|
+
module.exports = new SpoSiteRecycleBinItemListCommand();
|
|
76
|
+
//# sourceMappingURL=site-recyclebinitem-list.js.map
|
|
@@ -183,6 +183,7 @@ exports.default = {
|
|
|
183
183
|
SITE_GROUPIFY: `${prefix} site groupify`,
|
|
184
184
|
SITE_LIST: `${prefix} site list`,
|
|
185
185
|
SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
|
|
186
|
+
SITE_RECYCLEBINITEM_LIST: `${prefix} site recyclebinitem list`,
|
|
186
187
|
SITE_REMOVE: `${prefix} site remove`,
|
|
187
188
|
SITE_RENAME: `${prefix} site rename`,
|
|
188
189
|
SITE_SET: `${prefix} site set`,
|
|
@@ -25,24 +25,27 @@ class TeamsAppListCommand extends GraphItemsListCommand_1.GraphItemsListCommand
|
|
|
25
25
|
if (args.options.teamId) {
|
|
26
26
|
return Promise.resolve(args.options.teamId);
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
url: `${this.resource}/v1.0/
|
|
28
|
+
const requestOptions = {
|
|
29
|
+
url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(args.options.teamName)}'`,
|
|
30
30
|
headers: {
|
|
31
31
|
accept: 'application/json;odata.metadata=none'
|
|
32
32
|
},
|
|
33
33
|
responseType: 'json'
|
|
34
34
|
};
|
|
35
35
|
return request_1.default
|
|
36
|
-
.get(
|
|
36
|
+
.get(requestOptions)
|
|
37
37
|
.then(response => {
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
38
|
+
const groupItem = response.value[0];
|
|
39
|
+
if (!groupItem) {
|
|
40
|
+
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
41
|
+
}
|
|
42
|
+
if (groupItem.resourceProvisioningOptions.indexOf('Team') === -1) {
|
|
40
43
|
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
41
44
|
}
|
|
42
45
|
if (response.value.length > 1) {
|
|
43
46
|
return Promise.reject(`Multiple Microsoft Teams teams with name ${args.options.teamName} found: ${response.value.map(x => x.id)}`);
|
|
44
47
|
}
|
|
45
|
-
return Promise.resolve(
|
|
48
|
+
return Promise.resolve(groupItem.id);
|
|
46
49
|
});
|
|
47
50
|
}
|
|
48
51
|
getEndpointUrl(args) {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Utils_1 = require("../../../../Utils");
|
|
4
|
+
const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class TeamsChatMessageListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.CHAT_MESSAGE_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Lists all messages from a chat';
|
|
12
|
+
}
|
|
13
|
+
defaultProperties() {
|
|
14
|
+
return ['id', 'shortBody'];
|
|
15
|
+
}
|
|
16
|
+
commandAction(logger, args, cb) {
|
|
17
|
+
const endpoint = `${this.resource}/v1.0/chats/${args.options.chatId}/messages`;
|
|
18
|
+
this
|
|
19
|
+
.getAllItems(endpoint, logger, true)
|
|
20
|
+
.then(() => {
|
|
21
|
+
if (args.options.output !== 'json') {
|
|
22
|
+
this.items.forEach(i => {
|
|
23
|
+
// hoist the content to body for readability
|
|
24
|
+
i.body = i.body.content;
|
|
25
|
+
let shortBody;
|
|
26
|
+
const bodyToProcess = i.body;
|
|
27
|
+
if (bodyToProcess) {
|
|
28
|
+
let maxLength = 50;
|
|
29
|
+
let addedDots = '...';
|
|
30
|
+
if (bodyToProcess.length < maxLength) {
|
|
31
|
+
maxLength = bodyToProcess.length;
|
|
32
|
+
addedDots = '';
|
|
33
|
+
}
|
|
34
|
+
shortBody = bodyToProcess.replace(/\n/g, ' ').substring(0, maxLength) + addedDots;
|
|
35
|
+
}
|
|
36
|
+
i.shortBody = shortBody;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
logger.log(this.items);
|
|
40
|
+
cb();
|
|
41
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
42
|
+
}
|
|
43
|
+
options() {
|
|
44
|
+
const options = [
|
|
45
|
+
{
|
|
46
|
+
option: '-i, --chatId <chatId>'
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
const parentOptions = super.options();
|
|
50
|
+
return options.concat(parentOptions);
|
|
51
|
+
}
|
|
52
|
+
validate(args) {
|
|
53
|
+
if (!Utils_1.default.isValidTeamsChatId(args.options.chatId)) {
|
|
54
|
+
return `${args.options.chatId} is not a valid Teams chat ID`;
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
module.exports = new TeamsChatMessageListCommand();
|
|
60
|
+
//# sourceMappingURL=chat-message-list.js.map
|
|
@@ -30,24 +30,27 @@ class TeamsTabGetCommand extends GraphCommand_1.default {
|
|
|
30
30
|
if (args.options.teamId) {
|
|
31
31
|
return Promise.resolve(args.options.teamId);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
url: `${this.resource}/v1.0/
|
|
33
|
+
const requestOptions = {
|
|
34
|
+
url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(args.options.teamName)}'`,
|
|
35
35
|
headers: {
|
|
36
36
|
accept: 'application/json;odata.metadata=none'
|
|
37
37
|
},
|
|
38
38
|
responseType: 'json'
|
|
39
39
|
};
|
|
40
40
|
return request_1.default
|
|
41
|
-
.get(
|
|
41
|
+
.get(requestOptions)
|
|
42
42
|
.then(response => {
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
43
|
+
const groupItem = response.value[0];
|
|
44
|
+
if (!groupItem) {
|
|
45
|
+
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
46
|
+
}
|
|
47
|
+
if (groupItem.resourceProvisioningOptions.indexOf('Team') === -1) {
|
|
45
48
|
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
46
49
|
}
|
|
47
50
|
if (response.value.length > 1) {
|
|
48
51
|
return Promise.reject(`Multiple Microsoft Teams teams with name ${args.options.teamName} found: ${response.value.map(x => x.id)}`);
|
|
49
52
|
}
|
|
50
|
-
return Promise.resolve(
|
|
53
|
+
return Promise.resolve(groupItem.id);
|
|
51
54
|
});
|
|
52
55
|
}
|
|
53
56
|
getChannelId(args) {
|
|
@@ -15,6 +15,7 @@ exports.default = {
|
|
|
15
15
|
CHANNEL_SET: `${prefix} channel set`,
|
|
16
16
|
CHAT_LIST: `${prefix} chat list`,
|
|
17
17
|
CHAT_MEMBER_LIST: `${prefix} chat member list`,
|
|
18
|
+
CHAT_MESSAGE_LIST: `${prefix} chat message list`,
|
|
18
19
|
CONVERSATIONMEMBER_ADD: `${prefix} conversationmember add`,
|
|
19
20
|
CONVERSATIONMEMBER_LIST: `${prefix} conversationmember list`,
|
|
20
21
|
FUNSETTINGS_LIST: `${prefix} funsettings list`,
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# planner task set
|
|
2
|
+
|
|
3
|
+
Updates a Microsoft Planner task
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 planner task set [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-i, --id <id>`
|
|
14
|
+
: ID of the task.
|
|
15
|
+
|
|
16
|
+
`-t, --title [title]`
|
|
17
|
+
: New title of the task.
|
|
18
|
+
|
|
19
|
+
`--bucketId [bucketId]`
|
|
20
|
+
: ID of the bucket to move the task to. Specify either `bucketId` or `bucketName` but not both.
|
|
21
|
+
|
|
22
|
+
`--bucketName [bucketName]`
|
|
23
|
+
: Name of the bucket to move the task to. The bucket needs to exist in the selected plan. Specify either `bucketId` or `bucketName` but not both.
|
|
24
|
+
|
|
25
|
+
`--planId [planId]`
|
|
26
|
+
: ID of the plan to move the task to. Specify either `planId` or `planName` but not both.
|
|
27
|
+
|
|
28
|
+
`--planName [planName]`
|
|
29
|
+
: Name of the plan to move the task to. Specify either `planId` or `planName` but not both.
|
|
30
|
+
|
|
31
|
+
`--ownerGroupId [ownerGroupId]`
|
|
32
|
+
: ID of the group to which the plan belongs. Specify `ownerGroupId` or `ownerGroupName` when using `planName`.
|
|
33
|
+
|
|
34
|
+
`--ownerGroupName [ownerGroupName]`
|
|
35
|
+
: Name of the group to which the plan belongs. Specify `ownerGroupId` or `ownerGroupName` when using `planName`.
|
|
36
|
+
|
|
37
|
+
`--startDateTime [startDateTime]`
|
|
38
|
+
: The date and time when the task started. This should be defined as a valid ISO 8601 string. `2021-12-16T18:28:48.6964197Z`
|
|
39
|
+
|
|
40
|
+
`--dueDateTime [dueDateTime]`
|
|
41
|
+
: The date and time when the task is due. This should be defined as a valid ISO 8601 string. `2021-12-16T18:28:48.6964197Z`
|
|
42
|
+
|
|
43
|
+
`--percentComplete [percentComplete]`
|
|
44
|
+
: Percentage of task completion. Number between 0 and 100.
|
|
45
|
+
|
|
46
|
+
`--assignedToUserIds [assignedToUserIds]`
|
|
47
|
+
: Comma-separated IDs of the assignees that should be added to the task assignment. Specify either `assignedToUserIds` or `assignedToUserNames` but not both.
|
|
48
|
+
|
|
49
|
+
`--assignedToUserNames [assignedToUserNames]`
|
|
50
|
+
: Comma-separated UPNs of the assignees that should be added to the task assignment. Specify either `assignedToUserIds` or `assignedToUserNames` but not both.
|
|
51
|
+
|
|
52
|
+
`--description [description]`
|
|
53
|
+
: Description of the task
|
|
54
|
+
|
|
55
|
+
`--orderHint [orderHint]`
|
|
56
|
+
: Hint used to order items of this type in a list view
|
|
57
|
+
|
|
58
|
+
`--assigneePriority [assigneePriority]`
|
|
59
|
+
: Hint used to order items of this type in a list view
|
|
60
|
+
|
|
61
|
+
`--appliedCategories [appliedCategories]`
|
|
62
|
+
: Comma-separated categories that should be added to the task
|
|
63
|
+
|
|
64
|
+
--8<-- "docs/cmd/_global.md"
|
|
65
|
+
|
|
66
|
+
## Remarks
|
|
67
|
+
|
|
68
|
+
When you specify the value for `percentageComplete`, consider the following:
|
|
69
|
+
|
|
70
|
+
- when set to 0, the task is considered _Not started_
|
|
71
|
+
- when set between 1 and 99, the task is considered _In progress_
|
|
72
|
+
- when set to 100, the task is considered _Completed_
|
|
73
|
+
|
|
74
|
+
You can add up to 6 categories to the task. An example to add _category1_ and _category3_ would be `category1,category3`.
|
|
75
|
+
|
|
76
|
+
## Examples
|
|
77
|
+
|
|
78
|
+
Updates a Microsoft Planner task name to _My Planner Task_ for the task with the ID _Z-RLQGfppU6H3663DBzfs5gAMD3o_
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
m365 planner task set --id "Z-RLQGfppU6H3663DBzfs5gAMD3o" --title "My Planner Task"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Moves a Microsoft Planner task with the ID _Z-RLQGfppU6H3663DBzfs5gAMD3o_ to the bucket named _My Planner Bucket_. Based on the plan with the name _My Planner Plan_ owned by the group _My Planner Group_
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
m365 planner task set --id "2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2" --bucketName "My Planner Bucket" --planName "My Planner Plan" --ownerGroupName "My Planner Group"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Marks a Microsoft Planner task with the ID _Z-RLQGfppU6H3663DBzfs5gAMD3o_ as 50% complete and assigned to categories 1 and 3.
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
m365 planner task set --id "2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2" --percentComplete 50 --appliedCategories "category1,category3"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Additional information
|
|
97
|
+
|
|
98
|
+
- Using order hints in Planner: [https://docs.microsoft.com/graph/api/resources/planner-order-hint-format?view=graph-rest-1.0](https://docs.microsoft.com/graph/api/resources/planner-order-hint-format?view=graph-rest-1.0)
|
|
99
|
+
- Applied categories in Planner: [https://docs.microsoft.com/graph/api/resources/plannerappliedcategories?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/resources/plannerappliedcategories?view=graph-rest-1.0)
|
|
@@ -13,24 +13,42 @@ m365 spo group user add [options]
|
|
|
13
13
|
`-u, --webUrl <webUrl>`
|
|
14
14
|
: URL of the site where the SharePoint group is available
|
|
15
15
|
|
|
16
|
-
`--groupId
|
|
17
|
-
: Id of the SharePoint Group to which user needs to be added
|
|
16
|
+
`--groupId [groupId]`
|
|
17
|
+
: Id of the SharePoint Group to which user needs to be added, specify either `groupId` or `groupName`
|
|
18
18
|
|
|
19
|
-
`--
|
|
20
|
-
:
|
|
19
|
+
`--groupName [groupName]`
|
|
20
|
+
: Name of the SharePoint Group to which user needs to be added, specify either `groupId` or `groupName`
|
|
21
|
+
|
|
22
|
+
`--userName [userName]`
|
|
23
|
+
: User's UPN (user principal name, eg. megan.bowen@contoso.com). If multiple users needs to be added, they have to be comma separated (ex. megan.bowen@contoso.com,alex.wilber@contoso.com), specify either `userName` or `email`
|
|
24
|
+
|
|
25
|
+
`--email [email]`
|
|
26
|
+
: User's email (eg. megan.bowen@contoso.com). If multiple users needs to be added, they have to be comma separated (ex. megan.bowen@contoso.com,alex.wilber@contoso.com), specify either `userName` or `email`
|
|
21
27
|
|
|
22
28
|
--8<-- "docs/cmd/_global.md"
|
|
23
29
|
|
|
24
30
|
## Examples
|
|
25
31
|
|
|
26
|
-
Add a user to the SharePoint group with id _5_ available on the web _https://contoso.sharepoint.com/sites/SiteA_
|
|
32
|
+
Add a user with name _Alex.Wilber@contoso.com_ to the SharePoint group with id _5_ available on the web _https://contoso.sharepoint.com/sites/SiteA_
|
|
27
33
|
|
|
28
34
|
```sh
|
|
29
35
|
m365 spo group user add --webUrl https://contoso.sharepoint.com/sites/SiteA --groupId 5 --userName "Alex.Wilber@contoso.com"
|
|
30
36
|
```
|
|
31
37
|
|
|
32
|
-
Add multiple users to the SharePoint group with id _5_ available on the web _https://contoso.sharepoint.com/sites/SiteA_
|
|
38
|
+
Add multiple users by name to the SharePoint group with id _5_ available on the web _https://contoso.sharepoint.com/sites/SiteA_
|
|
33
39
|
|
|
34
40
|
```sh
|
|
35
41
|
m365 spo group user add --webUrl https://contoso.sharepoint.com/sites/SiteA --groupId 5 --userName "Alex.Wilber@contoso.com, Adele.Vance@contoso.com"
|
|
36
42
|
```
|
|
43
|
+
|
|
44
|
+
Add a user with email _Alex.Wilber@contoso.com_ to the SharePoint group with name _Contoso Site Owners_ available on the web _https://contoso.sharepoint.com/sites/SiteA_
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
m365 spo group user add --webUrl https://contoso.sharepoint.com/sites/SiteA --groupName "Contoso Site Owners" --email "Alex.Wilber@contoso.com"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Add multiple users by email to the SharePoint group with name _Contoso Site Owners_ available on the web _https://contoso.sharepoint.com/sites/SiteA_
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
m365 spo group user add --webUrl https://contoso.sharepoint.com/sites/SiteA --groupName "Contoso Site Owners" --email "Alex.Wilber@contoso.com, Adele.Vance@contoso.com"
|
|
54
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# spo site recyclebinitem list
|
|
2
|
+
|
|
3
|
+
Lists items from recycle bin
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 spo site recyclebinitem list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-u, --siteUrl <siteUrl>`
|
|
14
|
+
: URL of the site for which to retrieve the recycle bin items
|
|
15
|
+
|
|
16
|
+
`--type [type]`
|
|
17
|
+
: Type of items which should be retrieved (listItems, folders, files)
|
|
18
|
+
|
|
19
|
+
`--secondary`
|
|
20
|
+
: Use this switch to retrieve items from secondary recycle bin
|
|
21
|
+
|
|
22
|
+
--8<-- "docs/cmd/_global.md"
|
|
23
|
+
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
When type is not specified then the command will return all items in the recycle bin
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
Lists all files, items and folders from recycle bin for site _https://contoso.sharepoint.com/site_
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
m365 spo site recyclebinitem list --siteUrl https://contoso.sharepoint.com/site
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Lists only files from recycle bin for site _https://contoso.sharepoint.com/site_
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
m365 spo site recyclebinitem list --siteUrl https://contoso.sharepoint.com/site --type files
|
|
40
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# teams chat message list
|
|
2
|
+
|
|
3
|
+
Lists all messages from a Microsoft Teams chat conversation.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 teams chat message list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-i, --chatId <chatId>`
|
|
14
|
+
: The ID of the chat conversation
|
|
15
|
+
|
|
16
|
+
--8<-- "docs/cmd/_global.md"
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
List the messages from a Microsoft Teams chat conversation
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
m365 teams chat message list --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread.v2
|
|
24
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "4.4.0
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -226,4 +226,4 @@
|
|
|
226
226
|
"rimraf": "^3.0.2",
|
|
227
227
|
"sinon": "^12.0.1"
|
|
228
228
|
}
|
|
229
|
-
}
|
|
229
|
+
}
|