@pnp/cli-microsoft365 5.2.0-beta.6dee8b6 → 5.2.0-beta.87aa892
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/.eslintrc.js +0 -1
- package/dist/m365/aad/commands/user/user-signin-list.js +81 -0
- package/dist/m365/aad/commands.js +2 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +1 -105
- package/dist/m365/teams/commands/app/app-install.js +1 -1
- package/dist/m365/teams/commands/{conversationmember/conversationmember-add.js → channel/channel-member-add.js} +15 -22
- package/dist/m365/teams/commands/channel/{channel-membership-list.js → channel-member-list.js} +14 -7
- package/dist/m365/teams/commands/channel/channel-member-set.js +3 -0
- package/dist/m365/teams/commands.js +2 -1
- package/docs/docs/cmd/aad/user/user-signin-list.md +81 -0
- package/docs/docs/cmd/planner/task/task-list.md +1 -1
- package/docs/docs/cmd/spfx/spfx-doctor.md +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-list.md +2 -2
- package/docs/docs/cmd/teams/{conversationmember/conversationmember-add.md → channel/channel-member-add.md} +10 -4
- package/docs/docs/cmd/teams/channel/channel-member-list.md +54 -0
- package/package.json +3 -1
- package/dist/m365/teams/commands/conversationmember/conversationmember-list.js +0 -164
- package/docs/docs/cmd/teams/channel/channel-membership-list.md +0 -48
- package/docs/docs/cmd/teams/conversationmember/conversationmember-list.md +0 -39
package/.eslintrc.js
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../../../utils");
|
|
4
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class AadUserSigninListCommand extends GraphCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.USER_SIGNIN_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Retrieves the Azure AD user sign-ins for the tenant';
|
|
12
|
+
}
|
|
13
|
+
getTelemetryProperties(args) {
|
|
14
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
15
|
+
telemetryProps.userName = typeof args.options.userName !== 'undefined';
|
|
16
|
+
telemetryProps.userId = typeof args.options.userId !== 'undefined';
|
|
17
|
+
telemetryProps.appDisplayName = typeof args.options.appDisplayName !== 'undefined';
|
|
18
|
+
telemetryProps.appId = typeof args.options.appId !== 'undefined';
|
|
19
|
+
return telemetryProps;
|
|
20
|
+
}
|
|
21
|
+
defaultProperties() {
|
|
22
|
+
return ['id', 'userPrincipalName', 'appId', 'appDisplayName', 'createdDateTime'];
|
|
23
|
+
}
|
|
24
|
+
commandAction(logger, args, cb) {
|
|
25
|
+
let endpoint = `${this.resource}/v1.0/auditLogs/signIns`;
|
|
26
|
+
let filter = "";
|
|
27
|
+
if (args.options.userName || args.options.userId) {
|
|
28
|
+
filter = args.options.userId ?
|
|
29
|
+
`?$filter=userId eq '${encodeURIComponent(args.options.userId)}'` :
|
|
30
|
+
`?$filter=userPrincipalName eq '${encodeURIComponent(args.options.userName)}'`;
|
|
31
|
+
}
|
|
32
|
+
if (args.options.appId || args.options.appDisplayName) {
|
|
33
|
+
filter += filter ? " and " : "?$filter=";
|
|
34
|
+
filter += args.options.appId ?
|
|
35
|
+
`appId eq '${encodeURIComponent(args.options.appId)}'` :
|
|
36
|
+
`appDisplayName eq '${encodeURIComponent(args.options.appDisplayName)}'`;
|
|
37
|
+
}
|
|
38
|
+
endpoint += filter;
|
|
39
|
+
utils_1.odata
|
|
40
|
+
.getAllItems(endpoint, logger)
|
|
41
|
+
.then((signins) => {
|
|
42
|
+
logger.log(signins);
|
|
43
|
+
cb();
|
|
44
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
45
|
+
}
|
|
46
|
+
options() {
|
|
47
|
+
const options = [
|
|
48
|
+
{
|
|
49
|
+
option: '-n, --userName [userName]'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
option: '--userId [userId]'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
option: '--appDisplayName [appDisplayName]'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
option: '--appId [appId]'
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
const parentOptions = super.options();
|
|
62
|
+
return options.concat(parentOptions);
|
|
63
|
+
}
|
|
64
|
+
validate(args) {
|
|
65
|
+
if (args.options.userId && args.options.userName) {
|
|
66
|
+
return 'Specify either userId or userName, but not both';
|
|
67
|
+
}
|
|
68
|
+
if (args.options.appId && args.options.appDisplayName) {
|
|
69
|
+
return 'Specify either appId or appDisplayName, but not both';
|
|
70
|
+
}
|
|
71
|
+
if (args.options.userId && !utils_1.validation.isValidGuid(args.options.userId)) {
|
|
72
|
+
return `${args.options.userId} is not a valid GUID`;
|
|
73
|
+
}
|
|
74
|
+
if (args.options.appId && !utils_1.validation.isValidGuid(args.options.appId)) {
|
|
75
|
+
return `${args.options.appId} is not a valid GUID`;
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
module.exports = new AadUserSigninListCommand();
|
|
81
|
+
//# sourceMappingURL=user-signin-list.js.map
|
|
@@ -59,6 +59,7 @@ exports.default = {
|
|
|
59
59
|
USER_HIBP: `${prefix} user hibp`,
|
|
60
60
|
USER_LIST: `${prefix} user list`,
|
|
61
61
|
USER_PASSWORD_VALIDATE: `${prefix} user password validate`,
|
|
62
|
-
USER_SET: `${prefix} user set
|
|
62
|
+
USER_SET: `${prefix} user set`,
|
|
63
|
+
USER_SIGNIN_LIST: `${prefix} user signin list`
|
|
63
64
|
};
|
|
64
65
|
//# sourceMappingURL=commands.js.map
|
|
@@ -63,10 +63,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
63
63
|
range: '^6',
|
|
64
64
|
fix: 'Install Node.js v6'
|
|
65
65
|
},
|
|
66
|
-
react: {
|
|
67
|
-
range: '^15',
|
|
68
|
-
fix: 'npm i react@15'
|
|
69
|
-
},
|
|
70
66
|
sp: SharePointVersion.All,
|
|
71
67
|
yo: {
|
|
72
68
|
range: '^3',
|
|
@@ -82,10 +78,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
82
78
|
range: '^6',
|
|
83
79
|
fix: 'Install Node.js v6'
|
|
84
80
|
},
|
|
85
|
-
react: {
|
|
86
|
-
range: '^15',
|
|
87
|
-
fix: 'npm i react@15'
|
|
88
|
-
},
|
|
89
81
|
sp: SharePointVersion.All,
|
|
90
82
|
yo: {
|
|
91
83
|
range: '^3',
|
|
@@ -101,10 +93,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
101
93
|
range: '^6',
|
|
102
94
|
fix: 'Install Node.js v6'
|
|
103
95
|
},
|
|
104
|
-
react: {
|
|
105
|
-
range: '^15',
|
|
106
|
-
fix: 'npm i react@15'
|
|
107
|
-
},
|
|
108
96
|
sp: SharePointVersion.SP2019 | SharePointVersion.SPO,
|
|
109
97
|
yo: {
|
|
110
98
|
range: '^3',
|
|
@@ -120,10 +108,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
120
108
|
range: '^6',
|
|
121
109
|
fix: 'Install Node.js v6'
|
|
122
110
|
},
|
|
123
|
-
react: {
|
|
124
|
-
range: '^15',
|
|
125
|
-
fix: 'npm i react@15'
|
|
126
|
-
},
|
|
127
111
|
sp: SharePointVersion.SP2019 | SharePointVersion.SPO,
|
|
128
112
|
yo: {
|
|
129
113
|
range: '^3',
|
|
@@ -139,10 +123,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
139
123
|
range: '^6 || ^8',
|
|
140
124
|
fix: 'Install Node.js v8'
|
|
141
125
|
},
|
|
142
|
-
react: {
|
|
143
|
-
range: '^15',
|
|
144
|
-
fix: 'npm i react@15'
|
|
145
|
-
},
|
|
146
126
|
sp: SharePointVersion.SP2019 | SharePointVersion.SPO,
|
|
147
127
|
yo: {
|
|
148
128
|
range: '^3',
|
|
@@ -158,10 +138,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
158
138
|
range: '^6 || ^8',
|
|
159
139
|
fix: 'Install Node.js v8'
|
|
160
140
|
},
|
|
161
|
-
react: {
|
|
162
|
-
range: '^15',
|
|
163
|
-
fix: 'npm i react@15'
|
|
164
|
-
},
|
|
165
141
|
sp: SharePointVersion.SPO,
|
|
166
142
|
yo: {
|
|
167
143
|
range: '^3',
|
|
@@ -177,10 +153,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
177
153
|
range: '^6 || ^8',
|
|
178
154
|
fix: 'Install Node.js v8'
|
|
179
155
|
},
|
|
180
|
-
react: {
|
|
181
|
-
range: '^15',
|
|
182
|
-
fix: 'npm i react@15'
|
|
183
|
-
},
|
|
184
156
|
sp: SharePointVersion.SPO,
|
|
185
157
|
yo: {
|
|
186
158
|
range: '^3',
|
|
@@ -196,10 +168,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
196
168
|
range: '^6 || ^8',
|
|
197
169
|
fix: 'Install Node.js v8'
|
|
198
170
|
},
|
|
199
|
-
react: {
|
|
200
|
-
range: '^15',
|
|
201
|
-
fix: 'npm i react@15'
|
|
202
|
-
},
|
|
203
171
|
sp: SharePointVersion.SPO,
|
|
204
172
|
yo: {
|
|
205
173
|
range: '^3',
|
|
@@ -215,10 +183,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
215
183
|
range: '^8',
|
|
216
184
|
fix: 'Install Node.js v8'
|
|
217
185
|
},
|
|
218
|
-
react: {
|
|
219
|
-
range: '16.3.2',
|
|
220
|
-
fix: 'npm i react@16.3.2'
|
|
221
|
-
},
|
|
222
186
|
sp: SharePointVersion.SPO,
|
|
223
187
|
yo: {
|
|
224
188
|
range: '^3',
|
|
@@ -234,10 +198,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
234
198
|
range: '^8',
|
|
235
199
|
fix: 'Install Node.js v8'
|
|
236
200
|
},
|
|
237
|
-
react: {
|
|
238
|
-
range: '16.3.2',
|
|
239
|
-
fix: 'npm i react@16.3.2'
|
|
240
|
-
},
|
|
241
201
|
sp: SharePointVersion.SPO,
|
|
242
202
|
yo: {
|
|
243
203
|
range: '^3',
|
|
@@ -253,10 +213,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
253
213
|
range: '^8',
|
|
254
214
|
fix: 'Install Node.js v8'
|
|
255
215
|
},
|
|
256
|
-
react: {
|
|
257
|
-
range: '16.7.0',
|
|
258
|
-
fix: 'npm i react@16.7.0'
|
|
259
|
-
},
|
|
260
216
|
sp: SharePointVersion.SPO,
|
|
261
217
|
yo: {
|
|
262
218
|
range: '^3',
|
|
@@ -272,10 +228,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
272
228
|
range: '^8',
|
|
273
229
|
fix: 'Install Node.js v8'
|
|
274
230
|
},
|
|
275
|
-
react: {
|
|
276
|
-
range: '16.7.0',
|
|
277
|
-
fix: 'npm i react@16.7.0'
|
|
278
|
-
},
|
|
279
231
|
sp: SharePointVersion.SPO,
|
|
280
232
|
yo: {
|
|
281
233
|
range: '^3',
|
|
@@ -291,10 +243,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
291
243
|
range: '^8 || ^10',
|
|
292
244
|
fix: 'Install Node.js v10'
|
|
293
245
|
},
|
|
294
|
-
react: {
|
|
295
|
-
range: '16.7.0',
|
|
296
|
-
fix: 'npm i react@16.7.0'
|
|
297
|
-
},
|
|
298
246
|
sp: SharePointVersion.SPO,
|
|
299
247
|
yo: {
|
|
300
248
|
range: '^3',
|
|
@@ -310,10 +258,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
310
258
|
range: '^8 || ^10',
|
|
311
259
|
fix: 'Install Node.js v10'
|
|
312
260
|
},
|
|
313
|
-
react: {
|
|
314
|
-
range: '16.8.5',
|
|
315
|
-
fix: 'npm i react@16.8.5'
|
|
316
|
-
},
|
|
317
261
|
sp: SharePointVersion.SPO,
|
|
318
262
|
yo: {
|
|
319
263
|
range: '^3',
|
|
@@ -329,10 +273,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
329
273
|
range: '^10',
|
|
330
274
|
fix: 'Install Node.js v10'
|
|
331
275
|
},
|
|
332
|
-
react: {
|
|
333
|
-
range: '16.8.5',
|
|
334
|
-
fix: 'npm i react@16.8.5'
|
|
335
|
-
},
|
|
336
276
|
sp: SharePointVersion.SPO,
|
|
337
277
|
yo: {
|
|
338
278
|
range: '^3',
|
|
@@ -348,10 +288,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
348
288
|
range: '^10',
|
|
349
289
|
fix: 'Install Node.js v10'
|
|
350
290
|
},
|
|
351
|
-
react: {
|
|
352
|
-
range: '16.8.5',
|
|
353
|
-
fix: 'npm i react@16.8.5'
|
|
354
|
-
},
|
|
355
291
|
sp: SharePointVersion.SPO,
|
|
356
292
|
yo: {
|
|
357
293
|
range: '^3',
|
|
@@ -367,10 +303,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
367
303
|
range: '^10',
|
|
368
304
|
fix: 'Install Node.js v10'
|
|
369
305
|
},
|
|
370
|
-
react: {
|
|
371
|
-
range: '16.8.5',
|
|
372
|
-
fix: 'npm i react@16.8.5'
|
|
373
|
-
},
|
|
374
306
|
sp: SharePointVersion.SPO,
|
|
375
307
|
yo: {
|
|
376
308
|
range: '^3',
|
|
@@ -386,10 +318,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
386
318
|
range: '^12',
|
|
387
319
|
fix: 'Install Node.js v12'
|
|
388
320
|
},
|
|
389
|
-
react: {
|
|
390
|
-
range: '16.9.0',
|
|
391
|
-
fix: 'npm i react@16.9.0'
|
|
392
|
-
},
|
|
393
321
|
sp: SharePointVersion.SPO,
|
|
394
322
|
yo: {
|
|
395
323
|
range: '^3',
|
|
@@ -405,10 +333,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
405
333
|
range: '^12 || ^14',
|
|
406
334
|
fix: 'Install Node.js v12 or v14'
|
|
407
335
|
},
|
|
408
|
-
react: {
|
|
409
|
-
range: '16.9.36',
|
|
410
|
-
fix: 'npm i react@16.9.36'
|
|
411
|
-
},
|
|
412
336
|
sp: SharePointVersion.SPO,
|
|
413
337
|
yo: {
|
|
414
338
|
range: '^3',
|
|
@@ -424,10 +348,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
424
348
|
range: '^12 || ^14',
|
|
425
349
|
fix: 'Install Node.js v12 or v14'
|
|
426
350
|
},
|
|
427
|
-
react: {
|
|
428
|
-
range: '16.9.51',
|
|
429
|
-
fix: 'npm i react@16.9.51'
|
|
430
|
-
},
|
|
431
351
|
sp: SharePointVersion.SPO,
|
|
432
352
|
yo: {
|
|
433
353
|
range: '^4',
|
|
@@ -443,10 +363,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
443
363
|
range: '^12 || ^14',
|
|
444
364
|
fix: 'Install Node.js v12 or v14'
|
|
445
365
|
},
|
|
446
|
-
react: {
|
|
447
|
-
range: '16.9.51',
|
|
448
|
-
fix: 'npm i react@16.9.51'
|
|
449
|
-
},
|
|
450
366
|
sp: SharePointVersion.SPO,
|
|
451
367
|
yo: {
|
|
452
368
|
range: '^4',
|
|
@@ -462,10 +378,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
462
378
|
range: '^12 || ^14',
|
|
463
379
|
fix: 'Install Node.js v12 or v14'
|
|
464
380
|
},
|
|
465
|
-
react: {
|
|
466
|
-
range: '16.9.51',
|
|
467
|
-
fix: 'npm i react@16.9.51'
|
|
468
|
-
},
|
|
469
381
|
sp: SharePointVersion.SPO,
|
|
470
382
|
yo: {
|
|
471
383
|
range: '^4',
|
|
@@ -511,7 +423,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
511
423
|
.then(_ => this.checkNodeVersion(prerequisites, fixes, logger))
|
|
512
424
|
.then(_ => this.checkYo(prerequisites, fixes, logger))
|
|
513
425
|
.then(_ => this.checkGulp(prerequisites, fixes, logger))
|
|
514
|
-
.then(_ => this.checkReact(prerequisites, fixes, logger))
|
|
515
426
|
.then(_ => this.checkTypeScript(fixes, logger))
|
|
516
427
|
.then(_ => {
|
|
517
428
|
if (fixes.length > 0) {
|
|
@@ -586,13 +497,6 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
586
497
|
}
|
|
587
498
|
});
|
|
588
499
|
}
|
|
589
|
-
checkReact(prerequisites, fixes, logger) {
|
|
590
|
-
return this
|
|
591
|
-
.getPackageVersion('react', PackageSearchMode.LocalOnly, HandlePromise.Continue, logger)
|
|
592
|
-
.then((reactVersion) => {
|
|
593
|
-
this.checkStatus('react', reactVersion, prerequisites.react, OptionalOrRequired.Optional, fixes, logger);
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
500
|
checkTypeScript(fixes, logger) {
|
|
597
501
|
return this
|
|
598
502
|
.getPackageVersion('typescript', PackageSearchMode.LocalOnly, HandlePromise.Continue, logger)
|
|
@@ -713,15 +617,7 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
713
617
|
return process.version.substr(1);
|
|
714
618
|
}
|
|
715
619
|
checkStatus(what, versionFound, versionCheck, optionalOrRequired, fixes, logger) {
|
|
716
|
-
if (
|
|
717
|
-
// TODO: we might need this code in the future if SPFx introduces required
|
|
718
|
-
// prerequisites with a specific version
|
|
719
|
-
// if (optionalOrRequired === OptionalOrRequired.Required) {
|
|
720
|
-
// logger.log(this.getStatus(CheckStatus.Failure, `${what} not found, v${versionCheck.range} required`));
|
|
721
|
-
// fixes.push(versionCheck.fix);
|
|
722
|
-
// }
|
|
723
|
-
}
|
|
724
|
-
else {
|
|
620
|
+
if (versionFound) {
|
|
725
621
|
if ((0, semver_1.satisfies)(versionFound, versionCheck.range)) {
|
|
726
622
|
logger.log(this.getStatus(CheckStatus.Success, `${what} v${versionFound}`));
|
|
727
623
|
}
|
|
@@ -72,7 +72,7 @@ class TeamsAppInstallCommand extends GraphCommand_1.default {
|
|
|
72
72
|
options() {
|
|
73
73
|
const options = [
|
|
74
74
|
{ option: '--appId <appId>' },
|
|
75
|
-
{ option: '--teamId [teamId' },
|
|
75
|
+
{ option: '--teamId [teamId]' },
|
|
76
76
|
{ option: '--userId [userId]' },
|
|
77
77
|
{ option: '--userName [userName]' }
|
|
78
78
|
];
|
|
@@ -5,13 +5,16 @@ const request_1 = require("../../../../request");
|
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
6
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
7
|
const commands_1 = require("../../commands");
|
|
8
|
-
class
|
|
8
|
+
class TeamsChannelMemberAddCommand extends GraphCommand_1.default {
|
|
9
9
|
get name() {
|
|
10
|
-
return commands_1.default.
|
|
10
|
+
return commands_1.default.CHANNEL_MEMBER_ADD;
|
|
11
11
|
}
|
|
12
12
|
get description() {
|
|
13
13
|
return 'Adds a conversation member in a private channel.';
|
|
14
14
|
}
|
|
15
|
+
alias() {
|
|
16
|
+
return [commands_1.default.CONVERSATIONMEMBER_ADD];
|
|
17
|
+
}
|
|
15
18
|
getTelemetryProperties(args) {
|
|
16
19
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
17
20
|
telemetryProps.teamId = typeof args.options.teamId !== 'undefined';
|
|
@@ -24,6 +27,7 @@ class TeamsConversationMemberAddCommand extends GraphCommand_1.default {
|
|
|
24
27
|
return telemetryProps;
|
|
25
28
|
}
|
|
26
29
|
commandAction(logger, args, cb) {
|
|
30
|
+
this.showDeprecationWarning(logger, commands_1.default.CONVERSATIONMEMBER_ADD, commands_1.default.CHANNEL_MEMBER_ADD);
|
|
27
31
|
let teamId = '';
|
|
28
32
|
let channelId = '';
|
|
29
33
|
this
|
|
@@ -47,6 +51,13 @@ class TeamsConversationMemberAddCommand extends GraphCommand_1.default {
|
|
|
47
51
|
})
|
|
48
52
|
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
49
53
|
}
|
|
54
|
+
optionSets() {
|
|
55
|
+
return [
|
|
56
|
+
['teamId', 'teamName'],
|
|
57
|
+
['channelId', 'channelName'],
|
|
58
|
+
['userId', 'userDisplayName']
|
|
59
|
+
];
|
|
60
|
+
}
|
|
50
61
|
options() {
|
|
51
62
|
const options = [
|
|
52
63
|
{
|
|
@@ -75,30 +86,12 @@ class TeamsConversationMemberAddCommand extends GraphCommand_1.default {
|
|
|
75
86
|
return options.concat(parentOptions);
|
|
76
87
|
}
|
|
77
88
|
validate(args) {
|
|
78
|
-
if (args.options.teamId && args.options.teamName) {
|
|
79
|
-
return 'Specify either teamId or teamName, but not both.';
|
|
80
|
-
}
|
|
81
|
-
if (!args.options.teamId && !args.options.teamName) {
|
|
82
|
-
return 'Specify teamId or teamName, one is required';
|
|
83
|
-
}
|
|
84
89
|
if (args.options.teamId && !utils_1.validation.isValidGuid(args.options.teamId)) {
|
|
85
90
|
return `${args.options.teamId} is not a valid GUID`;
|
|
86
91
|
}
|
|
87
|
-
if (args.options.channelId && args.options.channelName) {
|
|
88
|
-
return 'Specify either channelId or channelName, but not both.';
|
|
89
|
-
}
|
|
90
|
-
if (!args.options.channelId && !args.options.channelName) {
|
|
91
|
-
return 'Specify channelId or channelName, one is required';
|
|
92
|
-
}
|
|
93
92
|
if (args.options.channelId && !utils_1.validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
94
93
|
return `${args.options.channelId} is not a valid Teams ChannelId`;
|
|
95
94
|
}
|
|
96
|
-
if (args.options.userId && args.options.userDisplayName) {
|
|
97
|
-
return 'Specify either userId or userDisplayName, but not both.';
|
|
98
|
-
}
|
|
99
|
-
if (!args.options.userId && !args.options.userDisplayName) {
|
|
100
|
-
return 'Specify userId or userDisplayName, one is required';
|
|
101
|
-
}
|
|
102
95
|
return true;
|
|
103
96
|
}
|
|
104
97
|
addUser(userId, endpoint, roles) {
|
|
@@ -196,5 +189,5 @@ class TeamsConversationMemberAddCommand extends GraphCommand_1.default {
|
|
|
196
189
|
}, err => { return Promise.reject(err); });
|
|
197
190
|
}
|
|
198
191
|
}
|
|
199
|
-
module.exports = new
|
|
200
|
-
//# sourceMappingURL=
|
|
192
|
+
module.exports = new TeamsChannelMemberAddCommand();
|
|
193
|
+
//# sourceMappingURL=channel-member-add.js.map
|
package/dist/m365/teams/commands/channel/{channel-membership-list.js → channel-member-list.js}
RENAMED
|
@@ -4,16 +4,19 @@ const utils_1 = require("../../../../utils");
|
|
|
4
4
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
5
5
|
const commands_1 = require("../../commands");
|
|
6
6
|
const request_1 = require("../../../../request");
|
|
7
|
-
class
|
|
7
|
+
class TeamsChannelMemberListCommand extends GraphCommand_1.default {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
10
|
this.teamId = '';
|
|
11
11
|
}
|
|
12
12
|
get name() {
|
|
13
|
-
return commands_1.default.
|
|
13
|
+
return commands_1.default.CHANNEL_MEMBER_LIST;
|
|
14
14
|
}
|
|
15
15
|
get description() {
|
|
16
|
-
return 'Lists
|
|
16
|
+
return 'Lists members of the specified Microsoft Teams team channel';
|
|
17
|
+
}
|
|
18
|
+
alias() {
|
|
19
|
+
return [commands_1.default.CONVERSATIONMEMBER_LIST];
|
|
17
20
|
}
|
|
18
21
|
defaultProperties() {
|
|
19
22
|
return ['id', 'roles', 'displayName', 'userId', 'email'];
|
|
@@ -28,6 +31,7 @@ class TeamsChannelMembershipListCommand extends GraphCommand_1.default {
|
|
|
28
31
|
return telemetryProps;
|
|
29
32
|
}
|
|
30
33
|
commandAction(logger, args, cb) {
|
|
34
|
+
this.showDeprecationWarning(logger, commands_1.default.CONVERSATIONMEMBER_LIST, commands_1.default.CHANNEL_MEMBER_LIST);
|
|
31
35
|
this
|
|
32
36
|
.getTeamId(args)
|
|
33
37
|
.then((teamId) => {
|
|
@@ -103,13 +107,13 @@ class TeamsChannelMembershipListCommand extends GraphCommand_1.default {
|
|
|
103
107
|
options() {
|
|
104
108
|
const options = [
|
|
105
109
|
{
|
|
106
|
-
option: '--teamId [teamId]'
|
|
110
|
+
option: '-i, --teamId [teamId]'
|
|
107
111
|
},
|
|
108
112
|
{
|
|
109
113
|
option: '--teamName [teamName]'
|
|
110
114
|
},
|
|
111
115
|
{
|
|
112
|
-
option: '--channelId [channelId]'
|
|
116
|
+
option: '-c, --channelId [channelId]'
|
|
113
117
|
},
|
|
114
118
|
{
|
|
115
119
|
option: '--channelName [channelName]'
|
|
@@ -138,6 +142,9 @@ class TeamsChannelMembershipListCommand extends GraphCommand_1.default {
|
|
|
138
142
|
if (!args.options.channelId && !args.options.channelName) {
|
|
139
143
|
return 'Specify channelId or channelName, one is required';
|
|
140
144
|
}
|
|
145
|
+
if (args.options.channelId && !utils_1.validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
146
|
+
return `${args.options.channelId} is not a valid Teams Channel ID`;
|
|
147
|
+
}
|
|
141
148
|
if (args.options.role) {
|
|
142
149
|
if (['owner', 'member', 'guest'].indexOf(args.options.role) === -1) {
|
|
143
150
|
return `${args.options.role} is not a valid role value. Allowed values owner|member|guest`;
|
|
@@ -146,5 +153,5 @@ class TeamsChannelMembershipListCommand extends GraphCommand_1.default {
|
|
|
146
153
|
return true;
|
|
147
154
|
}
|
|
148
155
|
}
|
|
149
|
-
module.exports = new
|
|
150
|
-
//# sourceMappingURL=channel-
|
|
156
|
+
module.exports = new TeamsChannelMemberListCommand();
|
|
157
|
+
//# sourceMappingURL=channel-member-list.js.map
|
|
@@ -182,6 +182,9 @@ class TeamsChannelMemberSetCommand extends GraphCommand_1.default {
|
|
|
182
182
|
if (!args.options.channelId && !args.options.channelName) {
|
|
183
183
|
return 'Specify channelId or channelName, one is required';
|
|
184
184
|
}
|
|
185
|
+
if (args.options.channelId && !utils_1.validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
186
|
+
return `${args.options.channelId} is not a valid Teams Channel ID`;
|
|
187
|
+
}
|
|
185
188
|
if ((args.options.userName && args.options.userId) ||
|
|
186
189
|
(args.options.userName && args.options.id) ||
|
|
187
190
|
(args.options.userId && args.options.id)) {
|
|
@@ -11,8 +11,9 @@ exports.default = {
|
|
|
11
11
|
CHANNEL_ADD: `${prefix} channel add`,
|
|
12
12
|
CHANNEL_GET: `${prefix} channel get`,
|
|
13
13
|
CHANNEL_LIST: `${prefix} channel list`,
|
|
14
|
+
CHANNEL_MEMBER_ADD: `${prefix} channel member add`,
|
|
15
|
+
CHANNEL_MEMBER_LIST: `${prefix} channel member list`,
|
|
14
16
|
CHANNEL_MEMBER_SET: `${prefix} channel member set`,
|
|
15
|
-
CHANNEL_MEMBERSHIP_LIST: `${prefix} channel membership list`,
|
|
16
17
|
CHANNEL_REMOVE: `${prefix} channel remove`,
|
|
17
18
|
CHANNEL_SET: `${prefix} channel set`,
|
|
18
19
|
CHAT_GET: `${prefix} chat get`,
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# aad user signin list
|
|
2
|
+
|
|
3
|
+
Retrieves the Azure AD user sign-ins for the tenant
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad user signin list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-n, --userName [userName]`
|
|
14
|
+
: Filter the user sign-ins by given User's UPN (user principal name), eg. `johndoe@example.com`. Specify either userName or userId
|
|
15
|
+
|
|
16
|
+
`--userId [userId]`
|
|
17
|
+
: Filter the user sign-ins by given User's Id. Specify either userName or userId
|
|
18
|
+
|
|
19
|
+
`--appDisplayName [appDisplayName]`
|
|
20
|
+
: Filter the user sign-ins by the given application display name. Specify either appDisplayName or appId
|
|
21
|
+
|
|
22
|
+
`--appId [appId]`
|
|
23
|
+
: Filter the user sign-ins by the given application identifier. Specify either appDisplayName or appId
|
|
24
|
+
|
|
25
|
+
--8<-- "docs/cmd/_global.md"
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
Get all user's sign-ins in your tenant
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
m365 aad user signin list
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Get all user's sign-ins filter by given user's UPN in the tenant
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
m365 aad user signin list --userName 'johndoe@example.com'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Get all user's sign-ins filter by given user's Id in the tenant
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
m365 aad user signin list --userId '11111111-1111-1111-1111-111111111111'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Get all user's sign-ins filter by given application display name in the tenant
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
m365 aad user signin list --appDisplayName 'Graph explorer'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Get all user's sign-ins filter by given application identifier in the tenant
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
m365 aad user signin list --appId '00000000-0000-0000-0000-000000000000'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Get all user's sign-ins filter by given user's UPN and application display name in the tenant
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
m365 aad user signin list --userName 'johndoe@example.com' --appDisplayName 'Graph explorer'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Get all user's sign-ins filter by given user's Id and application display name in the tenant
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
m365 aad user signin list --userId '11111111-1111-1111-1111-111111111111' --appDisplayName 'Graph explorer'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Get all user's sign-ins filter by given user's UPN and application identifier in the tenant
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
m365 aad user signin list --userName 'johndoe@example.com' --appId '00000000-0000-0000-0000-000000000000'
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Get all user's sign-ins filter by given user's Id and application identifier in the tenant
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
m365 aad user signin list --userId '11111111-1111-1111-1111-111111111111' --appId '00000000-0000-0000-0000-000000000000'
|
|
81
|
+
```
|
|
@@ -70,5 +70,5 @@ m365 planner task list --bucketName "My Bucket" --planId "iVPMIgdku0uFlou-KLNg6M
|
|
|
70
70
|
List the Microsoft Planner tasks in the bucket _My Bucket_ belonging to plan _My Plan_ in group _My Group_
|
|
71
71
|
|
|
72
72
|
```sh
|
|
73
|
-
m365 planner
|
|
73
|
+
m365 planner task list --bucketName "My Bucket" --planName "My Plan" --ownerGroupName "My Group"
|
|
74
74
|
```
|
|
@@ -37,7 +37,7 @@ This commands helps you to verify if your environment meets all prerequisites fo
|
|
|
37
37
|
|
|
38
38
|
The command starts by detecting the version of SharePoint Framework that you want to use. First, it looks at the current project. If you didn't run the command in the context of a SharePoint Framework project, the command will try to determine the SharePoint Framework version based on the SharePoint Framework Yeoman generator that you have installed either in the current directory or globally.
|
|
39
39
|
|
|
40
|
-
Based on the determined version of the SharePoint Framework, the command will look at other dependencies such as Node.js, npm, Yeoman, Gulp
|
|
40
|
+
Based on the determined version of the SharePoint Framework, the command will look at other dependencies such as Node.js, npm, Yeoman, Gulp and TypeScript to verify if their meet the requirements of that particular version of the SharePoint Framework.
|
|
41
41
|
|
|
42
42
|
If you miss any required tools or use a version that doesn't meet the SharePoint Framework requirements, the command will give you a list of recommendation how to address these issues.
|
|
43
43
|
|
|
@@ -13,10 +13,10 @@ m365 spo listitem list [options]
|
|
|
13
13
|
`-u, --webUrl <webUrl>`
|
|
14
14
|
: URL of the site from which the item should be retrieved
|
|
15
15
|
|
|
16
|
-
`-i, --id
|
|
16
|
+
`-i, --id [id]`
|
|
17
17
|
: ID of the list to retrieve items from. Specify `id` or `title` but not both
|
|
18
18
|
|
|
19
|
-
`-t, --title [
|
|
19
|
+
`-t, --title [title]`
|
|
20
20
|
: Title of the list from which to retrieve the item. Specify `id` or `title` but not both
|
|
21
21
|
|
|
22
22
|
`-q, --camlQuery [camlQuery]`
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
# teams
|
|
1
|
+
# teams channel member add
|
|
2
2
|
|
|
3
|
-
Adds a
|
|
3
|
+
Adds a specified member in the specified Microsoft Teams private team channel
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
+
```sh
|
|
8
|
+
m365 teams channel member add [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Alias
|
|
12
|
+
|
|
7
13
|
```sh
|
|
8
14
|
m365 teams conversationmember add [options]
|
|
9
15
|
```
|
|
@@ -44,11 +50,11 @@ You can only add members and owners of a Team to a private channel.
|
|
|
44
50
|
Add members to a channel based on their id or user principal name
|
|
45
51
|
|
|
46
52
|
```sh
|
|
47
|
-
m365 teams
|
|
53
|
+
m365 teams channel member add --teamId 47d6625d-a540-4b59-a4ab-19b787e40593 --channelId 19:586a8b9e36c4479bbbd378e439a96df2@thread.skype --userId "85a50aa1-e5b8-48ac-b8ce-8e338033c366,john.doe@contoso.com"
|
|
48
54
|
```
|
|
49
55
|
|
|
50
56
|
Add owners to a channel based on their display names
|
|
51
57
|
|
|
52
58
|
```sh
|
|
53
|
-
m365 teams
|
|
59
|
+
m365 teams channel member add --teamName "Human Resources" --channelName "Private Channel" --userDisplayName "Anne Matthews,John Doe" --owner
|
|
54
60
|
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# teams channel member list
|
|
2
|
+
|
|
3
|
+
Lists members of the specified Microsoft Teams team channel
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 teams channel member list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Alias
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
m365 teams conversationmember list [options]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
`-i, --teamId [teamId]`
|
|
20
|
+
: The Id of the Microsoft Teams team. Specify either `teamId` or `teamName` but not both
|
|
21
|
+
|
|
22
|
+
`--teamName [teamName]`
|
|
23
|
+
: The display name of the Microsoft Teams team. Specify either `teamId` or `teamName` but not both
|
|
24
|
+
|
|
25
|
+
`-c, --channelId [channelId]`
|
|
26
|
+
: The Id of the Microsoft Teams team channel. Specify either `channelId` or `channelName` but not both
|
|
27
|
+
|
|
28
|
+
`--channelName [channelName]`
|
|
29
|
+
: The display name of the Microsoft Teams team channel. Specify either `channelId` or `channelName` but not both
|
|
30
|
+
|
|
31
|
+
`-r, --role [role]`
|
|
32
|
+
: Filter the results to only users with the given role: owner, member, guest
|
|
33
|
+
|
|
34
|
+
--8<-- "docs/cmd/_global.md"
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
List the members of a specified Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 00:00000000000000000000000000000000@thread.skype
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
m365 teams channel member list --teamId 00000000-0000-0000-0000-000000000000 --channelId 00:00000000000000000000000000000000@thread.skype
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
List the members of a specified Microsoft Teams team with name _Team Name_ and channel with name _Channel Name_
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
m365 teams channel member list --teamName "Team Name" --channelName "Channel Name"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
List all owners of the specified Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 00:00000000000000000000000000000000@thread.skype
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
m365 teams channel member list --teamId 00000000-0000-0000-0000-000000000000 --channelId 00:00000000000000000000000000000000@thread.skype --role owner
|
|
54
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "5.2.0-beta.
|
|
3
|
+
"version": "5.2.0-beta.87aa892",
|
|
4
4
|
"description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/api.js",
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
}
|
|
85
85
|
],
|
|
86
86
|
"contributors": [
|
|
87
|
+
"Abhishek K M <67158080+Sync271@users.noreply.github.com>",
|
|
87
88
|
"Ågren, Simon <simon.agren@sogeti.com>",
|
|
88
89
|
"Akash Karda <akashkarda@gmail.com>",
|
|
89
90
|
"Albany, Bruce <bruce.albany@gmail.com>",
|
|
@@ -111,6 +112,7 @@
|
|
|
111
112
|
"Harding, Phil <pil.harding@platinumdogs.co.uk>",
|
|
112
113
|
"Hawrylak, Paweł <phawrylak@outlook.com>",
|
|
113
114
|
"Holemans, Milan <Milan.Holemans@vanroey.be>",
|
|
115
|
+
"Honen, Nicholas <nickhonen@gmail.com>",
|
|
114
116
|
"Högberg, Joakim <joakim.hogberg@bravero.se>",
|
|
115
117
|
"Hvam, Allan <ahp@delegate.dk>",
|
|
116
118
|
"Jaakke, Robert <robert.jaakke@mavention.nl>",
|
|
@@ -1,164 +0,0 @@
|
|
|
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 TeamsConversationMemberListCommand extends GraphCommand_1.default {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.teamId = "";
|
|
11
|
-
}
|
|
12
|
-
get name() {
|
|
13
|
-
return commands_1.default.CONVERSATIONMEMBER_LIST;
|
|
14
|
-
}
|
|
15
|
-
get description() {
|
|
16
|
-
return 'Lists members of a channel in Microsoft Teams in the current tenant.';
|
|
17
|
-
}
|
|
18
|
-
getTelemetryProperties(args) {
|
|
19
|
-
const telemetryProps = super.getTelemetryProperties(args);
|
|
20
|
-
telemetryProps.teamId = typeof args.options.teamId !== 'undefined';
|
|
21
|
-
telemetryProps.teamName = typeof args.options.teamName !== 'undefined';
|
|
22
|
-
telemetryProps.channelId = typeof args.options.channelId !== 'undefined';
|
|
23
|
-
telemetryProps.channelName = typeof args.options.channelName !== 'undefined';
|
|
24
|
-
return telemetryProps;
|
|
25
|
-
}
|
|
26
|
-
commandAction(logger, args, cb) {
|
|
27
|
-
this
|
|
28
|
-
.getTeamId(args)
|
|
29
|
-
.then((teamId) => {
|
|
30
|
-
this.teamId = teamId;
|
|
31
|
-
return this.getChannelId(teamId, args);
|
|
32
|
-
}).then((channelId) => {
|
|
33
|
-
const endpoint = `${this.resource}/v1.0/teams/${encodeURIComponent(this.teamId)}/channels/${encodeURIComponent(channelId)}/members`;
|
|
34
|
-
return utils_1.odata.getAllItems(endpoint, logger);
|
|
35
|
-
}).then((items) => {
|
|
36
|
-
if (args.options.output === 'json') {
|
|
37
|
-
logger.log(items);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
logger.log(items.map((c) => {
|
|
41
|
-
return {
|
|
42
|
-
id: c.id,
|
|
43
|
-
displayName: c.displayName,
|
|
44
|
-
userId: c.userId,
|
|
45
|
-
email: c.email
|
|
46
|
-
};
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
cb();
|
|
50
|
-
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
51
|
-
}
|
|
52
|
-
options() {
|
|
53
|
-
const options = [
|
|
54
|
-
{
|
|
55
|
-
option: '-i, --teamId [teamId]'
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
option: '--teamName [teamName]'
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
option: '-c, --channelId [channelId]'
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
option: '--channelName [channelName]'
|
|
65
|
-
}
|
|
66
|
-
];
|
|
67
|
-
const parentOptions = super.options();
|
|
68
|
-
return options.concat(parentOptions);
|
|
69
|
-
}
|
|
70
|
-
validate(args) {
|
|
71
|
-
if (args.options.teamId && args.options.teamName) {
|
|
72
|
-
return 'Specify either teamId or teamName, but not both.';
|
|
73
|
-
}
|
|
74
|
-
if (!args.options.teamId && !args.options.teamName) {
|
|
75
|
-
return 'Specify teamId or teamName, one is required';
|
|
76
|
-
}
|
|
77
|
-
if (args.options.teamId && !utils_1.validation.isValidGuid(args.options.teamId)) {
|
|
78
|
-
return `${args.options.teamId} is not a valid GUID`;
|
|
79
|
-
}
|
|
80
|
-
if (args.options.channelId && args.options.channelName) {
|
|
81
|
-
return 'Specify either channelId or channelName, but not both.';
|
|
82
|
-
}
|
|
83
|
-
if (!args.options.channelId && !args.options.channelName) {
|
|
84
|
-
return 'Specify channelId or channelName, one is required';
|
|
85
|
-
}
|
|
86
|
-
if (args.options.channelId && !utils_1.validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
87
|
-
return `${args.options.channelId} is not a valid Teams ChannelId`;
|
|
88
|
-
}
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
getTeamId(args) {
|
|
92
|
-
if (args.options.teamId) {
|
|
93
|
-
return Promise.resolve(args.options.teamId);
|
|
94
|
-
}
|
|
95
|
-
const requestOptions = {
|
|
96
|
-
url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(args.options.teamName)}'`,
|
|
97
|
-
headers: {
|
|
98
|
-
accept: 'application/json;odata.metadata=none'
|
|
99
|
-
},
|
|
100
|
-
responseType: 'json'
|
|
101
|
-
};
|
|
102
|
-
return request_1.default
|
|
103
|
-
.get(requestOptions)
|
|
104
|
-
.then(response => {
|
|
105
|
-
const filteredResponseByTeam = response.value.filter(t => t.resourceProvisioningOptions.includes('Team'));
|
|
106
|
-
const groupItem = filteredResponseByTeam[0];
|
|
107
|
-
if (!groupItem) {
|
|
108
|
-
return Promise.reject(`The specified team '${args.options.teamName}' does not exist in the Microsoft Teams`);
|
|
109
|
-
}
|
|
110
|
-
if (filteredResponseByTeam.length > 1) {
|
|
111
|
-
return Promise.reject(`Multiple Microsoft Teams teams with name '${args.options.teamName}' found: ${filteredResponseByTeam.map(x => x.id)}`);
|
|
112
|
-
}
|
|
113
|
-
return Promise.resolve(groupItem.id);
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
getChannelId(teamId, args) {
|
|
117
|
-
if (args.options.channelId) {
|
|
118
|
-
const channelIdRequestOptions = {
|
|
119
|
-
url: `${this.resource}/v1.0/teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(args.options.channelId)}`,
|
|
120
|
-
headers: {
|
|
121
|
-
accept: 'application/json;odata.metadata=none'
|
|
122
|
-
},
|
|
123
|
-
responseType: 'json'
|
|
124
|
-
};
|
|
125
|
-
return new Promise((resolve, reject) => {
|
|
126
|
-
request_1.default
|
|
127
|
-
.get(channelIdRequestOptions)
|
|
128
|
-
.then((response) => {
|
|
129
|
-
const channelItem = response;
|
|
130
|
-
return resolve(channelItem.id);
|
|
131
|
-
}, (err) => {
|
|
132
|
-
if (err.error && err.error.code === "NotFound") {
|
|
133
|
-
return reject(`The specified channel '${args.options.channelId}' does not exist or is invalid in the Microsoft Teams team with ID '${teamId}'`);
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
return reject(err);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
const channelRequestOptions = {
|
|
143
|
-
url: `${this.resource}/v1.0/teams/${encodeURIComponent(teamId)}/channels?$filter=displayName eq '${encodeURIComponent(args.options.channelName)}'`,
|
|
144
|
-
headers: {
|
|
145
|
-
accept: 'application/json;odata.metadata=none'
|
|
146
|
-
},
|
|
147
|
-
responseType: 'json'
|
|
148
|
-
};
|
|
149
|
-
return new Promise((resolve, reject) => {
|
|
150
|
-
request_1.default
|
|
151
|
-
.get(channelRequestOptions)
|
|
152
|
-
.then(response => {
|
|
153
|
-
const channelItem = response.value[0];
|
|
154
|
-
if (!channelItem) {
|
|
155
|
-
return reject(`The specified channel '${args.options.channelName}' does not exist in the Microsoft Teams team with ID '${teamId}'`);
|
|
156
|
-
}
|
|
157
|
-
return resolve(channelItem.id);
|
|
158
|
-
}, err => reject(err));
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
module.exports = new TeamsConversationMemberListCommand();
|
|
164
|
-
//# sourceMappingURL=conversationmember-list.js.map
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# teams channel membership list
|
|
2
|
-
|
|
3
|
-
Lists memberships in the specified Microsoft Teams team channel
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
m365 teams channel membership list [options]
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Options
|
|
12
|
-
|
|
13
|
-
`--teamId [teamId]`
|
|
14
|
-
: The Id of the Microsoft Teams team. Specify either `teamId` or `teamName` but not both
|
|
15
|
-
|
|
16
|
-
`--teamName [teamName]`
|
|
17
|
-
: The display name of the Microsoft Teams team. Specify either `teamId` or `teamName` but not both
|
|
18
|
-
|
|
19
|
-
`--channelId [channelId]`
|
|
20
|
-
: The Id of the Microsoft Teams team channel. Specify either `channelId` or `channelName` but not both
|
|
21
|
-
|
|
22
|
-
`--channelName [channelName]`
|
|
23
|
-
: The display name of the Microsoft Teams team channel. Specify either `channelId` or `channelName` but not both
|
|
24
|
-
|
|
25
|
-
`-r, --role [role]`
|
|
26
|
-
: Filter the results to only users with the given role: owner, member, guest
|
|
27
|
-
|
|
28
|
-
--8<-- "docs/cmd/_global.md"
|
|
29
|
-
|
|
30
|
-
## Examples
|
|
31
|
-
|
|
32
|
-
List the memberships in a specified Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 00:00000000000000000000000000000000@thread.skype
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
m365 teams channel membership list --teamId 00000000-0000-0000-0000-000000000000 --channelId 00:00000000000000000000000000000000@thread.skype
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
List the memberships in a specified Microsoft Teams team with name _Team Name_ and channel with name _Channel Name_
|
|
39
|
-
|
|
40
|
-
```sh
|
|
41
|
-
m365 teams channel membership list --teamName "Team Name" --channelName "Channel Name"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
List all owner memberships in the specified Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 00:00000000000000000000000000000000@thread.skype
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
m365 teams channel membership list --teamId 00000000-0000-0000-0000-000000000000 --channelId 00:00000000000000000000000000000000@thread.skype --role owner
|
|
48
|
-
```
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# teams conversationmember list
|
|
2
|
-
|
|
3
|
-
Lists members of a channel in Microsoft Teams in the current tenant
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
m365 teams conversationmember list [options]
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Options
|
|
12
|
-
|
|
13
|
-
`-i, --teamId [teamId]`
|
|
14
|
-
: The ID of the team where the channel is located. Specify either `teamId` or `teamName`, but not both.
|
|
15
|
-
|
|
16
|
-
`--teamName [teamName]`
|
|
17
|
-
: The name of the team where the channel is located. Specify either `teamId` or `teamName`, but not both.
|
|
18
|
-
|
|
19
|
-
`-c, --channelId [channelId]`
|
|
20
|
-
: The ID of the channel for which to list members. Specify either `channelId` or `channelName`, but not both.
|
|
21
|
-
|
|
22
|
-
`--channelName [channelName]`
|
|
23
|
-
: The name of the channel for which to list members. Specify either `channelId` or `channelName`, but not both.
|
|
24
|
-
|
|
25
|
-
--8<-- "docs/cmd/_global.md"
|
|
26
|
-
|
|
27
|
-
## Examples
|
|
28
|
-
|
|
29
|
-
List all members of a channel based on their ids
|
|
30
|
-
|
|
31
|
-
```sh
|
|
32
|
-
m365 teams conversationmember list --teamId 47d6625d-a540-4b59-a4ab-19b787e40593 --channelId 19:586a8b9e36c4479bbbd378e439a96df2@thread.skype
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
List all members of a channel based on their names
|
|
36
|
-
|
|
37
|
-
```sh
|
|
38
|
-
m365 teams conversationmember list --teamName "Human Resources" --channelName "Private Channel"
|
|
39
|
-
```
|