@pnp/cli-microsoft365 11.0.0-beta.1f852eb → 11.0.0-beta.3d99ea3
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.cjs +2 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/entra/commands/app/app-add.js +14 -2
- package/dist/m365/outlook/commands/mail/mail-searchfolder-add.js +85 -0
- package/dist/m365/outlook/commands.js +1 -0
- package/dist/m365/pp/commands.js +0 -4
- package/dist/m365/spo/commands/customaction/customaction-list.js +3 -10
- package/dist/m365/spo/commands/homesite/homesite-set.js +88 -44
- package/dist/m365/spo/commands.js +0 -1
- package/dist/m365/teams/commands/report/report-directroutingcalls.js +5 -12
- package/dist/m365/teams/commands/report/report-pstncalls.js +5 -12
- package/dist/m365/viva/commands.js +0 -3
- package/dist/utils/entraApp.js +15 -0
- package/docs/docs/cmd/entra/app/app-add.mdx +7 -1
- package/docs/docs/cmd/outlook/mail/mail-searchfolder-add.mdx +147 -0
- package/docs/docs/cmd/spo/homesite/homesite-set.mdx +85 -45
- package/docs/docs/cmd/teams/report/report-directroutingcalls.mdx +25 -44
- package/docs/docs/cmd/teams/report/report-pstncalls.mdx +25 -48
- package/docs/docs/cmd/viva/engage/engage-community-list.mdx +19 -0
- package/docs/docs/cmd/viva/engage/engage-community-user-add.mdx +19 -0
- package/docs/docs/cmd/viva/engage/engage-community-user-remove.mdx +19 -0
- package/npm-shrinkwrap.json +51 -51
- package/package.json +12 -12
- package/dist/m365/pp/commands/card/card-clone.js +0 -101
- package/dist/m365/pp/commands/card/card-get.js +0 -89
- package/dist/m365/pp/commands/card/card-list.js +0 -55
- package/dist/m365/pp/commands/card/card-remove.js +0 -105
- package/dist/m365/skype/commands/report/report-activitycounts.js +0 -15
- package/dist/m365/skype/commands/report/report-activityusercounts.js +0 -15
- package/dist/m365/skype/commands/report/report-activityuserdetail.js +0 -15
- package/dist/m365/skype/commands.js +0 -7
- package/dist/m365/spo/commands/mail/mail-send.js +0 -108
- package/dist/m365/viva/commands/engage/engage-group-list.js +0 -93
- package/dist/m365/viva/commands/engage/engage-group-user-add.js +0 -73
- package/dist/m365/viva/commands/engage/engage-group-user-remove.js +0 -88
- package/docs/docs/cmd/pp/card/card-clone.mdx +0 -103
- package/docs/docs/cmd/pp/card/card-get.mdx +0 -212
- package/docs/docs/cmd/pp/card/card-list.mdx +0 -163
- package/docs/docs/cmd/pp/card/card-remove.mdx +0 -86
- package/docs/docs/cmd/skype/report/report-activitycounts.mdx +0 -96
- package/docs/docs/cmd/skype/report/report-activityusercounts.mdx +0 -96
- package/docs/docs/cmd/skype/report/report-activityuserdetail.mdx +0 -134
- package/docs/docs/cmd/spo/mail/mail-send.mdx +0 -69
- package/docs/docs/cmd/viva/engage/engage-group-list.mdx +0 -174
- package/docs/docs/cmd/viva/engage/engage-group-user-add.mdx +0 -60
- package/docs/docs/cmd/viva/engage/engage-group-user-remove.mdx +0 -58
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import PeriodBasedReport from '../../../base/PeriodBasedReport.js';
|
|
2
|
-
import commands from '../../commands.js';
|
|
3
|
-
class SkypeReportActivityUserCountsCommand extends PeriodBasedReport {
|
|
4
|
-
get name() {
|
|
5
|
-
return commands.REPORT_ACTIVITYUSERCOUNTS;
|
|
6
|
-
}
|
|
7
|
-
get usageEndpoint() {
|
|
8
|
-
return 'getSkypeForBusinessActivityUserCounts';
|
|
9
|
-
}
|
|
10
|
-
get description() {
|
|
11
|
-
return 'Gets the trends on how many unique users organized and participated in conference sessions held in your organization through Skype for Business. The report also includes the number of peer-to-peer sessions';
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export default new SkypeReportActivityUserCountsCommand();
|
|
15
|
-
//# sourceMappingURL=report-activityusercounts.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import DateAndPeriodBasedReport from '../../../base/DateAndPeriodBasedReport.js';
|
|
2
|
-
import commands from '../../commands.js';
|
|
3
|
-
class SkypeReportActivityUserDetailCommand extends DateAndPeriodBasedReport {
|
|
4
|
-
get name() {
|
|
5
|
-
return commands.REPORT_ACTIVITYUSERDETAIL;
|
|
6
|
-
}
|
|
7
|
-
get usageEndpoint() {
|
|
8
|
-
return 'getSkypeForBusinessActivityUserDetail';
|
|
9
|
-
}
|
|
10
|
-
get description() {
|
|
11
|
-
return 'Gets details about Skype for Business activity by user';
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export default new SkypeReportActivityUserDetailCommand();
|
|
15
|
-
//# sourceMappingURL=report-activityuserdetail.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const prefix = 'skype';
|
|
2
|
-
export default {
|
|
3
|
-
REPORT_ACTIVITYCOUNTS: `${prefix} report activitycounts`,
|
|
4
|
-
REPORT_ACTIVITYUSERCOUNTS: `${prefix} report activityusercounts`,
|
|
5
|
-
REPORT_ACTIVITYUSERDETAIL: `${prefix} report activityuserdetail`
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=commands.js.map
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _SpoMailSendCommand_instances, _SpoMailSendCommand_initTelemetry, _SpoMailSendCommand_initOptions, _SpoMailSendCommand_initValidators;
|
|
7
|
-
import request from '../../../../request.js';
|
|
8
|
-
import { validation } from '../../../../utils/validation.js';
|
|
9
|
-
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
|
-
import commands from '../../commands.js';
|
|
11
|
-
import outlookCommands from '../../../outlook/commands.js';
|
|
12
|
-
class SpoMailSendCommand extends SpoCommand {
|
|
13
|
-
get name() {
|
|
14
|
-
return commands.MAIL_SEND;
|
|
15
|
-
}
|
|
16
|
-
get description() {
|
|
17
|
-
return 'Sends an e-mail from SharePoint';
|
|
18
|
-
}
|
|
19
|
-
constructor() {
|
|
20
|
-
super();
|
|
21
|
-
_SpoMailSendCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoMailSendCommand_instances, "m", _SpoMailSendCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoMailSendCommand_instances, "m", _SpoMailSendCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoMailSendCommand_instances, "m", _SpoMailSendCommand_initValidators).call(this);
|
|
25
|
-
}
|
|
26
|
-
async commandAction(logger, args) {
|
|
27
|
-
await this.showDeprecationWarning(logger, commands.MAIL_SEND, outlookCommands.MAIL_SEND);
|
|
28
|
-
const params = {
|
|
29
|
-
properties: {
|
|
30
|
-
__metadata: { "type": "SP.Utilities.EmailProperties" },
|
|
31
|
-
Body: args.options.body,
|
|
32
|
-
Subject: args.options.subject,
|
|
33
|
-
To: { results: args.options.to.replace(/\s+/g, '').split(',') }
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
if (args.options.from && args.options.from.length > 0) {
|
|
37
|
-
params.properties.From = args.options.from;
|
|
38
|
-
}
|
|
39
|
-
if (args.options.cc && args.options.cc.length > 0) {
|
|
40
|
-
params.properties.CC = { results: args.options.cc.replace(/\s+/g, '').split(',') };
|
|
41
|
-
}
|
|
42
|
-
if (args.options.bcc && args.options.bcc.length > 0) {
|
|
43
|
-
params.properties.BCC = { results: args.options.bcc.replace(/\s+/g, '').split(',') };
|
|
44
|
-
}
|
|
45
|
-
if (args.options.additionalHeaders) {
|
|
46
|
-
const h = JSON.parse(args.options.additionalHeaders);
|
|
47
|
-
params.properties.AdditionalHeaders = {
|
|
48
|
-
__metadata: { "type": "Collection(SP.KeyValue)" },
|
|
49
|
-
results: Object.keys(h).map(key => {
|
|
50
|
-
return {
|
|
51
|
-
__metadata: {
|
|
52
|
-
type: 'SP.KeyValue'
|
|
53
|
-
},
|
|
54
|
-
Key: key,
|
|
55
|
-
Value: h[key],
|
|
56
|
-
ValueType: 'Edm.String'
|
|
57
|
-
};
|
|
58
|
-
})
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
const requestOptions = {
|
|
62
|
-
url: `${args.options.webUrl}/_api/SP.Utilities.Utility.SendEmail`,
|
|
63
|
-
headers: {
|
|
64
|
-
'content-type': 'application/json;odata=verbose'
|
|
65
|
-
},
|
|
66
|
-
responseType: 'json',
|
|
67
|
-
data: params
|
|
68
|
-
};
|
|
69
|
-
try {
|
|
70
|
-
await request.post(requestOptions);
|
|
71
|
-
}
|
|
72
|
-
catch (err) {
|
|
73
|
-
this.handleRejectedODataJsonPromise(err);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
_SpoMailSendCommand_instances = new WeakSet(), _SpoMailSendCommand_initTelemetry = function _SpoMailSendCommand_initTelemetry() {
|
|
78
|
-
this.telemetry.push((args) => {
|
|
79
|
-
Object.assign(this.telemetryProperties, {
|
|
80
|
-
from: typeof args.options.from !== 'undefined',
|
|
81
|
-
cc: typeof args.options.cc !== 'undefined',
|
|
82
|
-
bcc: typeof args.options.bcc !== 'undefined',
|
|
83
|
-
additionalHeaders: typeof args.options.additionalHeaders !== 'undefined'
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
}, _SpoMailSendCommand_initOptions = function _SpoMailSendCommand_initOptions() {
|
|
87
|
-
this.options.unshift({
|
|
88
|
-
option: '-u, --webUrl <webUrl>'
|
|
89
|
-
}, {
|
|
90
|
-
option: '--to <to>'
|
|
91
|
-
}, {
|
|
92
|
-
option: '--subject <subject>'
|
|
93
|
-
}, {
|
|
94
|
-
option: '--body <body>'
|
|
95
|
-
}, {
|
|
96
|
-
option: '--from [from]'
|
|
97
|
-
}, {
|
|
98
|
-
option: '--cc [cc]'
|
|
99
|
-
}, {
|
|
100
|
-
option: '--bcc [bcc]'
|
|
101
|
-
}, {
|
|
102
|
-
option: '--additionalHeaders [additionalHeaders]'
|
|
103
|
-
});
|
|
104
|
-
}, _SpoMailSendCommand_initValidators = function _SpoMailSendCommand_initValidators() {
|
|
105
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
106
|
-
};
|
|
107
|
-
export default new SpoMailSendCommand();
|
|
108
|
-
//# sourceMappingURL=mail-send.js.map
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _VivaEngageGroupListCommand_instances, _VivaEngageGroupListCommand_initTelemetry, _VivaEngageGroupListCommand_initOptions, _VivaEngageGroupListCommand_initValidators;
|
|
7
|
-
import request from '../../../../request.js';
|
|
8
|
-
import VivaEngageCommand from '../../../base/VivaEngageCommand.js';
|
|
9
|
-
import commands from '../../commands.js';
|
|
10
|
-
class VivaEngageGroupListCommand extends VivaEngageCommand {
|
|
11
|
-
get name() {
|
|
12
|
-
return commands.ENGAGE_GROUP_LIST;
|
|
13
|
-
}
|
|
14
|
-
get description() {
|
|
15
|
-
return 'Returns the list of groups in a Viva Engage network or the groups for a specific user';
|
|
16
|
-
}
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
_VivaEngageGroupListCommand_instances.add(this);
|
|
20
|
-
this.items = [];
|
|
21
|
-
__classPrivateFieldGet(this, _VivaEngageGroupListCommand_instances, "m", _VivaEngageGroupListCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _VivaEngageGroupListCommand_instances, "m", _VivaEngageGroupListCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _VivaEngageGroupListCommand_instances, "m", _VivaEngageGroupListCommand_initValidators).call(this);
|
|
24
|
-
}
|
|
25
|
-
defaultProperties() {
|
|
26
|
-
return ['id', 'name', 'email', 'privacy', 'external', 'moderated'];
|
|
27
|
-
}
|
|
28
|
-
async getAllItems(logger, args, page) {
|
|
29
|
-
let endpoint = `${this.resource}/v1`;
|
|
30
|
-
if (args.options.userId) {
|
|
31
|
-
endpoint += `/groups/for_user/${args.options.userId}.json`;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
endpoint += `/groups.json`;
|
|
35
|
-
}
|
|
36
|
-
endpoint += `?page=${page}`;
|
|
37
|
-
const requestOptions = {
|
|
38
|
-
url: endpoint,
|
|
39
|
-
headers: {
|
|
40
|
-
accept: 'application/json;odata.metadata=none',
|
|
41
|
-
'content-type': 'application/json;odata=nometadata'
|
|
42
|
-
},
|
|
43
|
-
responseType: 'json'
|
|
44
|
-
};
|
|
45
|
-
const output = await request.get(requestOptions);
|
|
46
|
-
if (!output.length) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
this.items = this.items.concat(output);
|
|
50
|
-
if (args.options.limit && this.items.length > args.options.limit) {
|
|
51
|
-
this.items = this.items.slice(0, args.options.limit);
|
|
52
|
-
}
|
|
53
|
-
else if (this.items.length % 50 === 0) {
|
|
54
|
-
await this.getAllItems(logger, args, ++page);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
async commandAction(logger, args) {
|
|
58
|
-
this.items = []; // this will reset the items array in interactive mode
|
|
59
|
-
try {
|
|
60
|
-
await this.getAllItems(logger, args, 1);
|
|
61
|
-
await logger.log(this.items);
|
|
62
|
-
}
|
|
63
|
-
catch (err) {
|
|
64
|
-
this.handleRejectedODataJsonPromise(err);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
_VivaEngageGroupListCommand_instances = new WeakSet(), _VivaEngageGroupListCommand_initTelemetry = function _VivaEngageGroupListCommand_initTelemetry() {
|
|
69
|
-
this.telemetry.push((args) => {
|
|
70
|
-
Object.assign(this.telemetryProperties, {
|
|
71
|
-
userId: args.options.userId !== undefined,
|
|
72
|
-
limit: args.options.limit !== undefined
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
}, _VivaEngageGroupListCommand_initOptions = function _VivaEngageGroupListCommand_initOptions() {
|
|
76
|
-
this.options.unshift({
|
|
77
|
-
option: '--userId [userId]'
|
|
78
|
-
}, {
|
|
79
|
-
option: '--limit [limit]'
|
|
80
|
-
});
|
|
81
|
-
}, _VivaEngageGroupListCommand_initValidators = function _VivaEngageGroupListCommand_initValidators() {
|
|
82
|
-
this.validators.push(async (args) => {
|
|
83
|
-
if (args.options.userId && typeof args.options.userId !== 'number') {
|
|
84
|
-
return `${args.options.userId} is not a number`;
|
|
85
|
-
}
|
|
86
|
-
if (args.options.limit && typeof args.options.limit !== 'number') {
|
|
87
|
-
return `${args.options.limit} is not a number`;
|
|
88
|
-
}
|
|
89
|
-
return true;
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
export default new VivaEngageGroupListCommand();
|
|
93
|
-
//# sourceMappingURL=engage-group-list.js.map
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _VivaEngageGroupUserAddCommand_instances, _VivaEngageGroupUserAddCommand_initTelemetry, _VivaEngageGroupUserAddCommand_initOptions, _VivaEngageGroupUserAddCommand_initValidators;
|
|
7
|
-
import request from '../../../../request.js';
|
|
8
|
-
import VivaEngageCommand from '../../../base/VivaEngageCommand.js';
|
|
9
|
-
import commands from '../../commands.js';
|
|
10
|
-
class VivaEngageGroupUserAddCommand extends VivaEngageCommand {
|
|
11
|
-
get name() {
|
|
12
|
-
return commands.ENGAGE_GROUP_USER_ADD;
|
|
13
|
-
}
|
|
14
|
-
get description() {
|
|
15
|
-
return 'Adds a user to a Viva Engage Group';
|
|
16
|
-
}
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
_VivaEngageGroupUserAddCommand_instances.add(this);
|
|
20
|
-
__classPrivateFieldGet(this, _VivaEngageGroupUserAddCommand_instances, "m", _VivaEngageGroupUserAddCommand_initTelemetry).call(this);
|
|
21
|
-
__classPrivateFieldGet(this, _VivaEngageGroupUserAddCommand_instances, "m", _VivaEngageGroupUserAddCommand_initOptions).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _VivaEngageGroupUserAddCommand_instances, "m", _VivaEngageGroupUserAddCommand_initValidators).call(this);
|
|
23
|
-
}
|
|
24
|
-
async commandAction(logger, args) {
|
|
25
|
-
const requestOptions = {
|
|
26
|
-
url: `${this.resource}/v1/group_memberships.json`,
|
|
27
|
-
headers: {
|
|
28
|
-
accept: 'application/json;odata.metadata=none',
|
|
29
|
-
'content-type': 'application/json;odata=nometadata'
|
|
30
|
-
},
|
|
31
|
-
responseType: 'json',
|
|
32
|
-
data: {
|
|
33
|
-
group_id: args.options.groupId,
|
|
34
|
-
user_id: args.options.id,
|
|
35
|
-
email: args.options.email
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
try {
|
|
39
|
-
await request.post(requestOptions);
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
this.handleRejectedODataJsonPromise(err);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
_VivaEngageGroupUserAddCommand_instances = new WeakSet(), _VivaEngageGroupUserAddCommand_initTelemetry = function _VivaEngageGroupUserAddCommand_initTelemetry() {
|
|
47
|
-
this.telemetry.push((args) => {
|
|
48
|
-
Object.assign(this.telemetryProperties, {
|
|
49
|
-
id: typeof args.options.id !== 'undefined',
|
|
50
|
-
email: typeof args.options.email !== 'undefined'
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}, _VivaEngageGroupUserAddCommand_initOptions = function _VivaEngageGroupUserAddCommand_initOptions() {
|
|
54
|
-
this.options.unshift({
|
|
55
|
-
option: '--groupId <groupId>'
|
|
56
|
-
}, {
|
|
57
|
-
option: '--id [id]'
|
|
58
|
-
}, {
|
|
59
|
-
option: '--email [email]'
|
|
60
|
-
});
|
|
61
|
-
}, _VivaEngageGroupUserAddCommand_initValidators = function _VivaEngageGroupUserAddCommand_initValidators() {
|
|
62
|
-
this.validators.push(async (args) => {
|
|
63
|
-
if (typeof args.options.groupId !== 'number') {
|
|
64
|
-
return `${args.options.groupId} is not a number`;
|
|
65
|
-
}
|
|
66
|
-
if (args.options.id && typeof args.options.id !== 'number') {
|
|
67
|
-
return `${args.options.id} is not a number`;
|
|
68
|
-
}
|
|
69
|
-
return true;
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
export default new VivaEngageGroupUserAddCommand();
|
|
73
|
-
//# sourceMappingURL=engage-group-user-add.js.map
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _VivaEngageGroupUserRemoveCommand_instances, _VivaEngageGroupUserRemoveCommand_initTelemetry, _VivaEngageGroupUserRemoveCommand_initOptions, _VivaEngageGroupUserRemoveCommand_initValidators;
|
|
7
|
-
import { cli } from '../../../../cli/cli.js';
|
|
8
|
-
import request from '../../../../request.js';
|
|
9
|
-
import VivaEngageCommand from "../../../base/VivaEngageCommand.js";
|
|
10
|
-
import commands from '../../commands.js';
|
|
11
|
-
class VivaEngageGroupUserRemoveCommand extends VivaEngageCommand {
|
|
12
|
-
get name() {
|
|
13
|
-
return commands.ENGAGE_GROUP_USER_REMOVE;
|
|
14
|
-
}
|
|
15
|
-
get description() {
|
|
16
|
-
return 'Removes a user from a Viva Engage group';
|
|
17
|
-
}
|
|
18
|
-
constructor() {
|
|
19
|
-
super();
|
|
20
|
-
_VivaEngageGroupUserRemoveCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _VivaEngageGroupUserRemoveCommand_instances, "m", _VivaEngageGroupUserRemoveCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _VivaEngageGroupUserRemoveCommand_instances, "m", _VivaEngageGroupUserRemoveCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _VivaEngageGroupUserRemoveCommand_instances, "m", _VivaEngageGroupUserRemoveCommand_initValidators).call(this);
|
|
24
|
-
}
|
|
25
|
-
async commandAction(logger, args) {
|
|
26
|
-
if (args.options.force) {
|
|
27
|
-
await this.executeRemoveAction(args.options);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
let messagePrompt = `Are you sure you want to leave group ${args.options.groupId}?`;
|
|
31
|
-
if (args.options.id) {
|
|
32
|
-
messagePrompt = `Are you sure you want to remove the user ${args.options.id} from the group ${args.options.groupId}?`;
|
|
33
|
-
}
|
|
34
|
-
const result = await cli.promptForConfirmation({ message: messagePrompt });
|
|
35
|
-
if (result) {
|
|
36
|
-
await this.executeRemoveAction(args.options);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
async executeRemoveAction(options) {
|
|
41
|
-
const requestOptions = {
|
|
42
|
-
url: `${this.resource}/v1/group_memberships.json`,
|
|
43
|
-
headers: {
|
|
44
|
-
accept: 'application/json;odata.metadata=none',
|
|
45
|
-
'content-type': 'application/json;odata=nometadata'
|
|
46
|
-
},
|
|
47
|
-
responseType: 'json',
|
|
48
|
-
data: {
|
|
49
|
-
group_id: options.groupId,
|
|
50
|
-
user_id: options.id
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
try {
|
|
54
|
-
await request.delete(requestOptions);
|
|
55
|
-
}
|
|
56
|
-
catch (err) {
|
|
57
|
-
this.handleRejectedODataJsonPromise(err);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
_VivaEngageGroupUserRemoveCommand_instances = new WeakSet(), _VivaEngageGroupUserRemoveCommand_initTelemetry = function _VivaEngageGroupUserRemoveCommand_initTelemetry() {
|
|
62
|
-
this.telemetry.push((args) => {
|
|
63
|
-
Object.assign(this.telemetryProperties, {
|
|
64
|
-
userId: args.options.id !== undefined,
|
|
65
|
-
force: (!(!args.options.force)).toString()
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
}, _VivaEngageGroupUserRemoveCommand_initOptions = function _VivaEngageGroupUserRemoveCommand_initOptions() {
|
|
69
|
-
this.options.unshift({
|
|
70
|
-
option: '--groupId <groupId>'
|
|
71
|
-
}, {
|
|
72
|
-
option: '--id [id]'
|
|
73
|
-
}, {
|
|
74
|
-
option: '-f, --force'
|
|
75
|
-
});
|
|
76
|
-
}, _VivaEngageGroupUserRemoveCommand_initValidators = function _VivaEngageGroupUserRemoveCommand_initValidators() {
|
|
77
|
-
this.validators.push(async (args) => {
|
|
78
|
-
if (args.options.groupId && typeof args.options.groupId !== 'number') {
|
|
79
|
-
return `${args.options.groupId} is not a number`;
|
|
80
|
-
}
|
|
81
|
-
if (args.options.id && typeof args.options.id !== 'number') {
|
|
82
|
-
return `${args.options.id} is not a number`;
|
|
83
|
-
}
|
|
84
|
-
return true;
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
export default new VivaEngageGroupUserRemoveCommand();
|
|
88
|
-
//# sourceMappingURL=engage-group-user-remove.js.map
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
-
import Tabs from '@theme/Tabs';
|
|
3
|
-
import TabItem from '@theme/TabItem';
|
|
4
|
-
|
|
5
|
-
# pp card clone
|
|
6
|
-
|
|
7
|
-
Clones a specific Microsoft Power Platform card in the specified Power Platform environment
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
m365 pp card clone [options]
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Options
|
|
16
|
-
|
|
17
|
-
```md definition-list
|
|
18
|
-
`-e, --environmentName <environmentName>`
|
|
19
|
-
: The name of the environment.
|
|
20
|
-
|
|
21
|
-
`--newName <newName>`
|
|
22
|
-
: The name of the new card.
|
|
23
|
-
|
|
24
|
-
`-i, --id [id]`
|
|
25
|
-
: The id of the card. Specify either `id` or `name` but not both.
|
|
26
|
-
|
|
27
|
-
`-n, --name [name]`
|
|
28
|
-
: The name of the card. Specify either `id` or `name` but not both.
|
|
29
|
-
|
|
30
|
-
`--asAdmin`
|
|
31
|
-
: Run the command as admin for environments you do not have explicitly assigned permissions to.
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
<Global />
|
|
35
|
-
|
|
36
|
-
## Examples
|
|
37
|
-
|
|
38
|
-
Clones a specific card in a specific environment based on name.
|
|
39
|
-
|
|
40
|
-
```sh
|
|
41
|
-
m365 pp card clone --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Card" --newName "CLI 365 new Card"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Clones a specific card in a specific environment based on name as admin.
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
m365 pp card clone --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Card" --newName "CLI 365 new Card" --asAdmin
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Clones a specific card in a specific environment based on id.
|
|
51
|
-
|
|
52
|
-
```sh
|
|
53
|
-
m365 pp card clone --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --newName "CLI 365 new Card"
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Clones a specific card in a specific environment based on id as admin.
|
|
57
|
-
|
|
58
|
-
```sh
|
|
59
|
-
m365 pp card clone --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --newName "CLI 365 new Card" --asAdmin
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Response
|
|
63
|
-
|
|
64
|
-
<Tabs>
|
|
65
|
-
<TabItem value="JSON">
|
|
66
|
-
|
|
67
|
-
```json
|
|
68
|
-
{
|
|
69
|
-
"CardIdClone": "80cff342-ddf1-4633-aec1-6d3d131b29e0"
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
</TabItem>
|
|
74
|
-
<TabItem value="Text">
|
|
75
|
-
|
|
76
|
-
```text
|
|
77
|
-
CardIdClone: 80cff342-ddf1-4633-aec1-6d3d131b29e0
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
</TabItem>
|
|
81
|
-
<TabItem value="CSV">
|
|
82
|
-
|
|
83
|
-
```csv
|
|
84
|
-
CardIdClone
|
|
85
|
-
80cff342-ddf1-4633-aec1-6d3d131b29e0
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
</TabItem>
|
|
89
|
-
<TabItem value="Markdown">
|
|
90
|
-
|
|
91
|
-
```md
|
|
92
|
-
# pp card clone --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --newName "CLI 365 new Card"
|
|
93
|
-
|
|
94
|
-
Date: 9/1/2023
|
|
95
|
-
|
|
96
|
-
Property | Value
|
|
97
|
-
---------|-------
|
|
98
|
-
CardIdClone | 90460614-6ede-4231-8467-ce99a6359f45
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
</TabItem>
|
|
102
|
-
</Tabs>
|
|
103
|
-
|