@pnp/cli-microsoft365 10.1.0-beta.f17d225 → 10.2.0-beta.1819fcc
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/README.md +2 -2
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/AuthServer.js +1 -1
- package/dist/Command.js +2 -2
- package/dist/cli/cli.js +2 -2
- package/dist/m365/base/AppCommand.js +5 -2
- package/dist/m365/commands/login.js +3 -2
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +18 -4
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +34 -2
- package/dist/m365/entra/commands/app/app-get.js +17 -5
- package/dist/m365/entra/commands/app/app-list.js +34 -2
- package/dist/m365/entra/commands/app/app-permission-remove.js +8 -1
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +3 -0
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +3 -0
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +3 -0
- package/dist/m365/entra/commands/group/group-get.js +6 -3
- package/dist/m365/entra/commands/group/group-list.js +16 -1
- package/dist/m365/entra/commands/m365group/m365group-add.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +21 -6
- package/dist/m365/entra/commands/m365group/m365group-get.js +29 -7
- package/dist/m365/entra/commands/m365group/m365group-list.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-remove.js +21 -9
- package/dist/m365/entra/commands/m365group/m365group-renew.js +19 -7
- package/dist/m365/entra/commands/m365group/m365group-set.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-teamify.js +12 -21
- package/dist/m365/entra/commands/roledefinition/roledefinition-get.js +58 -0
- package/dist/m365/entra/commands/roledefinition/roledefinition-list.js +50 -0
- package/dist/m365/entra/commands/roledefinition/roledefinition-remove.js +74 -0
- package/dist/m365/entra/commands.js +3 -0
- package/dist/m365/file/commands/convert/convert-pdf.js +3 -4
- package/dist/m365/file/commands/file-add.js +5 -6
- package/dist/m365/graph/commands/subscription/subscription-add.js +46 -5
- package/dist/m365/pp/commands/{chatbot/chatbot-get.js → copilot/copilot-get.js} +24 -20
- package/dist/m365/pp/commands/{chatbot/chatbot-list.js → copilot/copilot-list.js} +16 -12
- package/dist/m365/pp/commands/{chatbot/chatbot-remove.js → copilot/copilot-remove.js} +28 -24
- package/dist/m365/pp/commands.js +3 -0
- package/dist/m365/spe/ContainerProperties.js +2 -0
- package/dist/m365/spe/commands/container/container-list.js +87 -0
- package/dist/m365/spe/commands/containertype/containertype-get.js +103 -0
- package/dist/m365/spe/commands/containertype/containertype-list.js +2 -22
- package/dist/m365/spe/commands.js +2 -0
- package/dist/m365/spfx/commands/package/package-generate.js +1 -1
- package/dist/m365/spfx/commands/project/JsonRule.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN016004_TS_property_pane_property_import.js +2 -2
- package/dist/m365/spfx/commands/spfx-doctor.js +1 -1
- package/dist/m365/spo/commands/contenttype/contenttype-get.js +2 -2
- package/dist/m365/spo/commands/contenttype/contenttype-list.js +6 -3
- package/dist/m365/spo/commands/file/file-add.js +1 -1
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +1 -2
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +1 -2
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +1 -2
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +1 -2
- package/dist/m365/spo/commands/list/list-contenttype-list.js +5 -2
- package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +10 -8
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +1 -2
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +1 -2
- package/dist/m365/spo/commands/page/page-add.js +1 -1
- package/dist/m365/spo/commands/site/site-admin-add.js +4 -12
- package/dist/m365/spo/commands/site/site-admin-list.js +3 -11
- package/dist/m365/spo/commands/site/site-admin-remove.js +4 -12
- package/dist/m365/spo/commands/site/site-set.js +1 -1
- package/dist/m365/spp/commands/model/model-remove.js +105 -0
- package/dist/m365/spp/commands.js +2 -1
- package/dist/m365/teams/commands/cache/cache-remove.js +3 -3
- package/dist/m365/teams/commands/user/user-app-list.js +1 -1
- package/dist/m365/tenant/commands/people/people-pronouns-get.js +32 -0
- package/dist/m365/tenant/commands/report/report-office365activationcounts.js +2 -8
- package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +2 -8
- package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +2 -8
- package/dist/m365/tenant/commands.js +1 -0
- package/dist/m365/todo/commands/list/list-remove.js +2 -1
- package/dist/m365/todo/commands/list/list-set.js +2 -1
- package/dist/m365/todo/commands/task/task-add.js +2 -1
- package/dist/m365/todo/commands/task/task-get.js +2 -1
- package/dist/m365/todo/commands/task/task-list.js +2 -1
- package/dist/m365/todo/commands/task/task-remove.js +2 -1
- package/dist/m365/todo/commands/task/task-set.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-set.js +111 -0
- package/dist/m365/viva/commands.js +1 -0
- package/dist/utils/entraAdministrativeUnit.js +14 -2
- package/dist/utils/entraGroup.js +49 -6
- package/dist/utils/formatting.js +8 -20
- package/dist/utils/roleDefinition.js +30 -3
- package/dist/utils/spo.js +31 -5
- package/dist/utils/spp.js +3 -3
- package/dist/utils/urlUtil.js +11 -14
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx +10 -3
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx +16 -1
- package/docs/docs/cmd/entra/app/app-get.mdx +13 -8
- package/docs/docs/cmd/entra/app/app-list.mdx +16 -1
- package/docs/docs/cmd/entra/group/group-get.mdx +10 -3
- package/docs/docs/cmd/entra/group/group-list.mdx +9 -2
- package/docs/docs/cmd/entra/m365group/m365group-conversation-list.mdx +12 -3
- package/docs/docs/cmd/entra/m365group/m365group-get.mdx +29 -5
- package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +7 -4
- package/docs/docs/cmd/entra/m365group/m365group-renew.mdx +11 -2
- package/docs/docs/cmd/entra/m365group/m365group-teamify.mdx +12 -3
- package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +2 -2
- package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +6 -0
- package/docs/docs/cmd/entra/m365group/m365group-user-remove.mdx +1 -1
- package/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +3 -3
- package/docs/docs/cmd/entra/roledefinition/roledefinition-get.mdx +150 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-list.mdx +148 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-remove.mdx +52 -0
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +30 -5
- package/docs/docs/cmd/login.mdx +45 -44
- package/docs/docs/cmd/pp/{chatbot/chatbot-get.mdx → copilot/copilot-get.mdx} +24 -18
- package/docs/docs/cmd/pp/{chatbot/chatbot-list.mdx → copilot/copilot-list.mdx} +20 -14
- package/docs/docs/cmd/pp/{chatbot/chatbot-remove.mdx → copilot/copilot-remove.mdx} +16 -10
- package/docs/docs/cmd/pp/managementapp/managementapp-add.mdx +1 -1
- package/docs/docs/cmd/spe/container/container-list.mdx +97 -0
- package/docs/docs/cmd/spe/containertype/containertype-get.mdx +114 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-get.mdx +7 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-list.mdx +7 -1
- package/docs/docs/cmd/spo/list/list-contenttype-list.mdx +7 -1
- package/docs/docs/cmd/spp/model/model-remove.mdx +57 -0
- package/docs/docs/cmd/tenant/people/people-pronouns-get.mdx +71 -0
- package/docs/docs/cmd/viva/engage/engage-community-set.mdx +61 -0
- package/npm-shrinkwrap.json +1513 -1543
- package/package.json +23 -21
- package/dist/m365/spe/ContainerTypeProperties.js +0 -2
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _EntraM365GroupRemoveCommand_instances, _EntraM365GroupRemoveCommand_initTelemetry, _EntraM365GroupRemoveCommand_initOptions, _EntraM365GroupRemoveCommand_initValidators;
|
|
6
|
+
var _EntraM365GroupRemoveCommand_instances, _EntraM365GroupRemoveCommand_initTelemetry, _EntraM365GroupRemoveCommand_initOptions, _EntraM365GroupRemoveCommand_initValidators, _EntraM365GroupRemoveCommand_initOptionSets, _EntraM365GroupRemoveCommand_initTypes;
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
@@ -28,23 +28,29 @@ class EntraM365GroupRemoveCommand extends GraphCommand {
|
|
|
28
28
|
__classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initTelemetry).call(this);
|
|
29
29
|
__classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initOptions).call(this);
|
|
30
30
|
__classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initValidators).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initOptionSets).call(this);
|
|
32
|
+
__classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initTypes).call(this);
|
|
31
33
|
}
|
|
32
34
|
async commandAction(logger, args) {
|
|
33
35
|
const removeGroup = async () => {
|
|
34
36
|
if (this.verbose) {
|
|
35
|
-
await logger.logToStderr(`Removing Microsoft 365 Group: ${args.options.id}...`);
|
|
37
|
+
await logger.logToStderr(`Removing Microsoft 365 Group: ${args.options.id || args.options.displayName}...`);
|
|
36
38
|
}
|
|
37
39
|
try {
|
|
38
|
-
|
|
40
|
+
let groupId = args.options.id;
|
|
41
|
+
if (args.options.displayName) {
|
|
42
|
+
groupId = await entraGroup.getGroupIdByDisplayName(args.options.displayName);
|
|
43
|
+
}
|
|
44
|
+
const isUnifiedGroup = await entraGroup.isUnifiedGroup(groupId);
|
|
39
45
|
if (!isUnifiedGroup) {
|
|
40
|
-
throw Error(`Specified group with id '${
|
|
46
|
+
throw Error(`Specified group with id '${groupId}' is not a Microsoft 365 group.`);
|
|
41
47
|
}
|
|
42
|
-
const siteUrl = await this.getM365GroupSiteUrl(logger,
|
|
48
|
+
const siteUrl = await this.getM365GroupSiteUrl(logger, groupId);
|
|
43
49
|
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
44
50
|
// Delete the Microsoft 365 group site. This operation will also delete the group.
|
|
45
51
|
await this.deleteM365GroupSite(logger, siteUrl, spoAdminUrl);
|
|
46
52
|
if (args.options.skipRecycleBin) {
|
|
47
|
-
await this.deleteM365GroupFromRecycleBin(logger,
|
|
53
|
+
await this.deleteM365GroupFromRecycleBin(logger, groupId);
|
|
48
54
|
await this.deleteSiteFromRecycleBin(logger, siteUrl, spoAdminUrl);
|
|
49
55
|
}
|
|
50
56
|
}
|
|
@@ -56,7 +62,7 @@ class EntraM365GroupRemoveCommand extends GraphCommand {
|
|
|
56
62
|
await removeGroup();
|
|
57
63
|
}
|
|
58
64
|
else {
|
|
59
|
-
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the group ${args.options.id}?` });
|
|
65
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the group ${args.options.id || args.options.displayName}?` });
|
|
60
66
|
if (result) {
|
|
61
67
|
await removeGroup();
|
|
62
68
|
}
|
|
@@ -168,7 +174,9 @@ _EntraM365GroupRemoveCommand_instances = new WeakSet(), _EntraM365GroupRemoveCom
|
|
|
168
174
|
});
|
|
169
175
|
}, _EntraM365GroupRemoveCommand_initOptions = function _EntraM365GroupRemoveCommand_initOptions() {
|
|
170
176
|
this.options.unshift({
|
|
171
|
-
option: '-i, --id
|
|
177
|
+
option: '-i, --id [id]'
|
|
178
|
+
}, {
|
|
179
|
+
option: '-n, --displayName [displayName]'
|
|
172
180
|
}, {
|
|
173
181
|
option: '-f, --force'
|
|
174
182
|
}, {
|
|
@@ -176,11 +184,15 @@ _EntraM365GroupRemoveCommand_instances = new WeakSet(), _EntraM365GroupRemoveCom
|
|
|
176
184
|
});
|
|
177
185
|
}, _EntraM365GroupRemoveCommand_initValidators = function _EntraM365GroupRemoveCommand_initValidators() {
|
|
178
186
|
this.validators.push(async (args) => {
|
|
179
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
187
|
+
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
180
188
|
return `${args.options.id} is not a valid GUID`;
|
|
181
189
|
}
|
|
182
190
|
return true;
|
|
183
191
|
});
|
|
192
|
+
}, _EntraM365GroupRemoveCommand_initOptionSets = function _EntraM365GroupRemoveCommand_initOptionSets() {
|
|
193
|
+
this.optionSets.push({ options: ['id', 'displayName'] });
|
|
194
|
+
}, _EntraM365GroupRemoveCommand_initTypes = function _EntraM365GroupRemoveCommand_initTypes() {
|
|
195
|
+
this.types.string.push('id', 'displayName');
|
|
184
196
|
};
|
|
185
197
|
EntraM365GroupRemoveCommand.maxRetries = 10;
|
|
186
198
|
export default new EntraM365GroupRemoveCommand();
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _EntraM365GroupRenewCommand_instances, _EntraM365GroupRenewCommand_initOptions, _EntraM365GroupRenewCommand_initValidators;
|
|
6
|
+
var _EntraM365GroupRenewCommand_instances, _EntraM365GroupRenewCommand_initOptions, _EntraM365GroupRenewCommand_initValidators, _EntraM365GroupRenewCommand_initOptionSets, _EntraM365GroupRenewCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -21,18 +21,24 @@ class EntraM365GroupRenewCommand extends GraphCommand {
|
|
|
21
21
|
_EntraM365GroupRenewCommand_instances.add(this);
|
|
22
22
|
__classPrivateFieldGet(this, _EntraM365GroupRenewCommand_instances, "m", _EntraM365GroupRenewCommand_initOptions).call(this);
|
|
23
23
|
__classPrivateFieldGet(this, _EntraM365GroupRenewCommand_instances, "m", _EntraM365GroupRenewCommand_initValidators).call(this);
|
|
24
|
+
__classPrivateFieldGet(this, _EntraM365GroupRenewCommand_instances, "m", _EntraM365GroupRenewCommand_initOptionSets).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _EntraM365GroupRenewCommand_instances, "m", _EntraM365GroupRenewCommand_initTypes).call(this);
|
|
24
26
|
}
|
|
25
27
|
async commandAction(logger, args) {
|
|
26
28
|
if (this.verbose) {
|
|
27
|
-
await logger.logToStderr(`Renewing Microsoft 365 group's expiration: ${args.options.id}...`);
|
|
29
|
+
await logger.logToStderr(`Renewing Microsoft 365 group's expiration: ${args.options.id || args.options.displayName}...`);
|
|
28
30
|
}
|
|
29
31
|
try {
|
|
30
|
-
|
|
32
|
+
let groupId = args.options.id;
|
|
33
|
+
if (args.options.displayName) {
|
|
34
|
+
groupId = await entraGroup.getGroupIdByDisplayName(args.options.displayName);
|
|
35
|
+
}
|
|
36
|
+
const isUnifiedGroup = await entraGroup.isUnifiedGroup(groupId);
|
|
31
37
|
if (!isUnifiedGroup) {
|
|
32
|
-
throw Error(`Specified group with id '${
|
|
38
|
+
throw Error(`Specified group with id '${groupId}' is not a Microsoft 365 group.`);
|
|
33
39
|
}
|
|
34
40
|
const requestOptions = {
|
|
35
|
-
url: `${this.resource}/v1.0/groups/${
|
|
41
|
+
url: `${this.resource}/v1.0/groups/${groupId}/renew/`,
|
|
36
42
|
headers: {
|
|
37
43
|
'accept': 'application/json;odata.metadata=none'
|
|
38
44
|
}
|
|
@@ -46,15 +52,21 @@ class EntraM365GroupRenewCommand extends GraphCommand {
|
|
|
46
52
|
}
|
|
47
53
|
_EntraM365GroupRenewCommand_instances = new WeakSet(), _EntraM365GroupRenewCommand_initOptions = function _EntraM365GroupRenewCommand_initOptions() {
|
|
48
54
|
this.options.unshift({
|
|
49
|
-
option: '-i, --id
|
|
55
|
+
option: '-i, --id [id]'
|
|
56
|
+
}, {
|
|
57
|
+
option: '-n, --displayName [displayName]'
|
|
50
58
|
});
|
|
51
59
|
}, _EntraM365GroupRenewCommand_initValidators = function _EntraM365GroupRenewCommand_initValidators() {
|
|
52
60
|
this.validators.push(async (args) => {
|
|
53
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
61
|
+
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
54
62
|
return `${args.options.id} is not a valid GUID`;
|
|
55
63
|
}
|
|
56
64
|
return true;
|
|
57
65
|
});
|
|
66
|
+
}, _EntraM365GroupRenewCommand_initOptionSets = function _EntraM365GroupRenewCommand_initOptionSets() {
|
|
67
|
+
this.optionSets.push({ options: ['id', 'displayName'] });
|
|
68
|
+
}, _EntraM365GroupRenewCommand_initTypes = function _EntraM365GroupRenewCommand_initTypes() {
|
|
69
|
+
this.types.string.push('id', 'displayName');
|
|
58
70
|
};
|
|
59
71
|
export default new EntraM365GroupRenewCommand();
|
|
60
72
|
//# sourceMappingURL=m365group-renew.js.map
|
|
@@ -128,7 +128,7 @@ class EntraM365GroupSetCommand extends GraphCommand {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
getImageContentType(imagePath) {
|
|
131
|
-
const extension = imagePath.
|
|
131
|
+
const extension = imagePath.substring(imagePath.lastIndexOf('.')).toLowerCase();
|
|
132
132
|
switch (extension) {
|
|
133
133
|
case '.png':
|
|
134
134
|
return 'image/png';
|
|
@@ -3,8 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _EntraM365GroupTeamifyCommand_instances, _EntraM365GroupTeamifyCommand_initTelemetry, _EntraM365GroupTeamifyCommand_initOptions, _EntraM365GroupTeamifyCommand_initValidators, _EntraM365GroupTeamifyCommand_initOptionSets;
|
|
7
|
-
import { cli } from '../../../../cli/cli.js';
|
|
6
|
+
var _EntraM365GroupTeamifyCommand_instances, _EntraM365GroupTeamifyCommand_initTelemetry, _EntraM365GroupTeamifyCommand_initOptions, _EntraM365GroupTeamifyCommand_initValidators, _EntraM365GroupTeamifyCommand_initOptionSets, _EntraM365GroupTeamifyCommand_initTypes;
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
10
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -25,29 +24,16 @@ class EntraM365GroupTeamifyCommand extends GraphCommand {
|
|
|
25
24
|
__classPrivateFieldGet(this, _EntraM365GroupTeamifyCommand_instances, "m", _EntraM365GroupTeamifyCommand_initOptions).call(this);
|
|
26
25
|
__classPrivateFieldGet(this, _EntraM365GroupTeamifyCommand_instances, "m", _EntraM365GroupTeamifyCommand_initValidators).call(this);
|
|
27
26
|
__classPrivateFieldGet(this, _EntraM365GroupTeamifyCommand_instances, "m", _EntraM365GroupTeamifyCommand_initOptionSets).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _EntraM365GroupTeamifyCommand_instances, "m", _EntraM365GroupTeamifyCommand_initTypes).call(this);
|
|
28
28
|
}
|
|
29
29
|
async getGroupId(options) {
|
|
30
30
|
if (options.id) {
|
|
31
31
|
return options.id;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
headers: {
|
|
36
|
-
accept: 'application/json;odata.metadata=none'
|
|
37
|
-
},
|
|
38
|
-
responseType: 'json'
|
|
39
|
-
};
|
|
40
|
-
const response = await request.get(requestOptions);
|
|
41
|
-
const groupItem = response.value[0];
|
|
42
|
-
if (!groupItem) {
|
|
43
|
-
throw `The specified Microsoft 365 Group does not exist`;
|
|
33
|
+
if (options.displayName) {
|
|
34
|
+
return await entraGroup.getGroupIdByDisplayName(options.displayName);
|
|
44
35
|
}
|
|
45
|
-
|
|
46
|
-
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', response.value);
|
|
47
|
-
const result = await cli.handleMultipleResultsFound(`Multiple Microsoft 365 Groups with name '${options.mailNickname}' found.`, resultAsKeyValuePair);
|
|
48
|
-
return result.id;
|
|
49
|
-
}
|
|
50
|
-
return groupItem.id;
|
|
36
|
+
return await entraGroup.getGroupIdByMailNickname(options.mailNickname);
|
|
51
37
|
}
|
|
52
38
|
async commandAction(logger, args) {
|
|
53
39
|
try {
|
|
@@ -89,12 +75,15 @@ _EntraM365GroupTeamifyCommand_instances = new WeakSet(), _EntraM365GroupTeamifyC
|
|
|
89
75
|
this.telemetry.push((args) => {
|
|
90
76
|
Object.assign(this.telemetryProperties, {
|
|
91
77
|
id: typeof args.options.id !== 'undefined',
|
|
92
|
-
mailNickname: typeof args.options.mailNickname !== 'undefined'
|
|
78
|
+
mailNickname: typeof args.options.mailNickname !== 'undefined',
|
|
79
|
+
displayName: typeof args.options.displayName !== 'undefined'
|
|
93
80
|
});
|
|
94
81
|
});
|
|
95
82
|
}, _EntraM365GroupTeamifyCommand_initOptions = function _EntraM365GroupTeamifyCommand_initOptions() {
|
|
96
83
|
this.options.unshift({
|
|
97
84
|
option: '-i, --id [id]'
|
|
85
|
+
}, {
|
|
86
|
+
option: '-n, --displayName [displayName]'
|
|
98
87
|
}, {
|
|
99
88
|
option: '--mailNickname [mailNickname]'
|
|
100
89
|
});
|
|
@@ -106,7 +95,9 @@ _EntraM365GroupTeamifyCommand_instances = new WeakSet(), _EntraM365GroupTeamifyC
|
|
|
106
95
|
return true;
|
|
107
96
|
});
|
|
108
97
|
}, _EntraM365GroupTeamifyCommand_initOptionSets = function _EntraM365GroupTeamifyCommand_initOptionSets() {
|
|
109
|
-
this.optionSets.push({ options: ['id', 'mailNickname'] });
|
|
98
|
+
this.optionSets.push({ options: ['id', 'displayName', 'mailNickname'] });
|
|
99
|
+
}, _EntraM365GroupTeamifyCommand_initTypes = function _EntraM365GroupTeamifyCommand_initTypes() {
|
|
100
|
+
this.types.string.push('id', 'displayName', 'mailNickname');
|
|
110
101
|
};
|
|
111
102
|
export default new EntraM365GroupTeamifyCommand();
|
|
112
103
|
//# sourceMappingURL=m365group-teamify.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
2
|
+
import commands from '../../commands.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
6
|
+
import { roleDefinition } from '../../../../utils/roleDefinition.js';
|
|
7
|
+
import { validation } from '../../../../utils/validation.js';
|
|
8
|
+
const options = globalOptionsZod
|
|
9
|
+
.extend({
|
|
10
|
+
id: zod.alias('i', z.string().optional()),
|
|
11
|
+
displayName: zod.alias('n', z.string().optional()),
|
|
12
|
+
properties: zod.alias('p', z.string().optional())
|
|
13
|
+
})
|
|
14
|
+
.strict();
|
|
15
|
+
class EntraRoleDefinitionGetCommand extends GraphCommand {
|
|
16
|
+
get name() {
|
|
17
|
+
return commands.ROLEDEFINITION_GET;
|
|
18
|
+
}
|
|
19
|
+
get description() {
|
|
20
|
+
return 'Gets a specific Microsoft Entra ID role definition';
|
|
21
|
+
}
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
24
|
+
}
|
|
25
|
+
getRefinedSchema(schema) {
|
|
26
|
+
return schema
|
|
27
|
+
.refine(options => !options.id !== !options.displayName, {
|
|
28
|
+
message: 'Specify either id or displayName, but not both'
|
|
29
|
+
})
|
|
30
|
+
.refine(options => options.id || options.displayName, {
|
|
31
|
+
message: 'Specify either id or displayName'
|
|
32
|
+
})
|
|
33
|
+
.refine(options => (!options.id && !options.displayName) || options.displayName || (options.id && validation.isValidGuid(options.id)), options => ({
|
|
34
|
+
message: `The '${options.id}' must be a valid GUID`,
|
|
35
|
+
path: ['id']
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
async commandAction(logger, args) {
|
|
39
|
+
if (this.verbose) {
|
|
40
|
+
await logger.logToStderr('Getting Microsoft Entra ID role definition...');
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
let result;
|
|
44
|
+
if (args.options.id) {
|
|
45
|
+
result = await roleDefinition.getRoleDefinitionById(args.options.id, args.options.properties);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
result = await roleDefinition.getRoleDefinitionByDisplayName(args.options.displayName, args.options.properties);
|
|
49
|
+
}
|
|
50
|
+
await logger.log(result);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
this.handleRejectedODataJsonPromise(err);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export default new EntraRoleDefinitionGetCommand();
|
|
58
|
+
//# sourceMappingURL=roledefinition-get.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { odata } from '../../../../utils/odata.js';
|
|
2
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
+
import { zod } from '../../../../utils/zod.js';
|
|
7
|
+
const options = globalOptionsZod
|
|
8
|
+
.extend({
|
|
9
|
+
properties: zod.alias('p', z.string().optional()),
|
|
10
|
+
filter: zod.alias('f', z.string().optional())
|
|
11
|
+
})
|
|
12
|
+
.strict();
|
|
13
|
+
class EntraRoleDefinitionListCommand extends GraphCommand {
|
|
14
|
+
get name() {
|
|
15
|
+
return commands.ROLEDEFINITION_LIST;
|
|
16
|
+
}
|
|
17
|
+
get description() {
|
|
18
|
+
return 'Lists all Microsoft Entra ID role definitions';
|
|
19
|
+
}
|
|
20
|
+
defaultProperties() {
|
|
21
|
+
return ['id', 'displayName', 'isBuiltIn', 'isEnabled'];
|
|
22
|
+
}
|
|
23
|
+
get schema() {
|
|
24
|
+
return options;
|
|
25
|
+
}
|
|
26
|
+
async commandAction(logger, args) {
|
|
27
|
+
if (this.verbose) {
|
|
28
|
+
await logger.logToStderr('Getting Microsoft Entra ID role definitions...');
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const queryParameters = [];
|
|
32
|
+
if (args.options.properties) {
|
|
33
|
+
queryParameters.push(`$select=${args.options.properties}`);
|
|
34
|
+
}
|
|
35
|
+
if (args.options.filter) {
|
|
36
|
+
queryParameters.push(`$filter=${args.options.filter}`);
|
|
37
|
+
}
|
|
38
|
+
const queryString = queryParameters.length > 0
|
|
39
|
+
? `?${queryParameters.join('&')}`
|
|
40
|
+
: '';
|
|
41
|
+
const results = await odata.getAllItems(`${this.resource}/v1.0/roleManagement/directory/roleDefinitions${queryString}`);
|
|
42
|
+
await logger.log(results);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
this.handleRejectedODataJsonPromise(err);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export default new EntraRoleDefinitionListCommand();
|
|
50
|
+
//# sourceMappingURL=roledefinition-list.js.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
2
|
+
import commands from '../../commands.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
6
|
+
import { roleDefinition } from '../../../../utils/roleDefinition.js';
|
|
7
|
+
import { validation } from '../../../../utils/validation.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { cli } from '../../../../cli/cli.js';
|
|
10
|
+
const options = globalOptionsZod
|
|
11
|
+
.extend({
|
|
12
|
+
id: zod.alias('i', z.string().optional()),
|
|
13
|
+
displayName: zod.alias('n', z.string().optional()),
|
|
14
|
+
force: zod.alias('f', z.boolean().optional())
|
|
15
|
+
})
|
|
16
|
+
.strict();
|
|
17
|
+
class EntraRoleDefinitionRemoveCommand extends GraphCommand {
|
|
18
|
+
get name() {
|
|
19
|
+
return commands.ROLEDEFINITION_REMOVE;
|
|
20
|
+
}
|
|
21
|
+
get description() {
|
|
22
|
+
return 'Removes a specific Microsoft Entra ID role definition';
|
|
23
|
+
}
|
|
24
|
+
get schema() {
|
|
25
|
+
return options;
|
|
26
|
+
}
|
|
27
|
+
getRefinedSchema(schema) {
|
|
28
|
+
return schema
|
|
29
|
+
.refine(options => !options.id !== !options.displayName, {
|
|
30
|
+
message: 'Specify either id or displayName, but not both'
|
|
31
|
+
})
|
|
32
|
+
.refine(options => options.id || options.displayName, {
|
|
33
|
+
message: 'Specify either id or displayName'
|
|
34
|
+
})
|
|
35
|
+
.refine(options => (!options.id && !options.displayName) || options.displayName || (options.id && validation.isValidGuid(options.id)), options => ({
|
|
36
|
+
message: `The '${options.id}' must be a valid GUID`,
|
|
37
|
+
path: ['id']
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
async commandAction(logger, args) {
|
|
41
|
+
const removeRoleDefinition = async () => {
|
|
42
|
+
try {
|
|
43
|
+
let roleDefinitionId = args.options.id;
|
|
44
|
+
if (args.options.displayName) {
|
|
45
|
+
roleDefinitionId = (await roleDefinition.getRoleDefinitionByDisplayName(args.options.displayName, 'id')).id;
|
|
46
|
+
}
|
|
47
|
+
if (args.options.verbose) {
|
|
48
|
+
await logger.logToStderr(`Removing role definition with ID ${roleDefinitionId}...`);
|
|
49
|
+
}
|
|
50
|
+
const requestOptions = {
|
|
51
|
+
url: `${this.resource}/v1.0/roleManagement/directory/roleDefinitions/${roleDefinitionId}`,
|
|
52
|
+
headers: {
|
|
53
|
+
accept: 'application/json;odata.metadata=none'
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
await request.delete(requestOptions);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
this.handleRejectedODataJsonPromise(err);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
if (args.options.force) {
|
|
63
|
+
await removeRoleDefinition();
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove role definition '${args.options.id || args.options.displayName}'?` });
|
|
67
|
+
if (result) {
|
|
68
|
+
await removeRoleDefinition();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export default new EntraRoleDefinitionRemoveCommand();
|
|
74
|
+
//# sourceMappingURL=roledefinition-remove.js.map
|
|
@@ -87,6 +87,9 @@ export default {
|
|
|
87
87
|
PIM_ROLE_ASSIGNMENT_ELIGIBILITY_LIST: `${prefix} pim role assignment eligibility list`,
|
|
88
88
|
PIM_ROLE_REQUEST_LIST: `${prefix} pim role request list`,
|
|
89
89
|
POLICY_LIST: `${prefix} policy list`,
|
|
90
|
+
ROLEDEFINITION_LIST: `${prefix} roledefinition list`,
|
|
91
|
+
ROLEDEFINITION_GET: `${prefix} roledefinition get`,
|
|
92
|
+
ROLEDEFINITION_REMOVE: `${prefix} roledefinition remove`,
|
|
90
93
|
SITECLASSIFICATION_DISABLE: `${prefix} siteclassification disable`,
|
|
91
94
|
SITECLASSIFICATION_ENABLE: `${prefix} siteclassification enable`,
|
|
92
95
|
SITECLASSIFICATION_GET: `${prefix} siteclassification get`,
|
|
@@ -7,7 +7,6 @@ var _FileConvertPdfCommand_instances, _FileConvertPdfCommand_initOptions, _FileC
|
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
import os from 'os';
|
|
9
9
|
import path from 'path';
|
|
10
|
-
import url from 'url';
|
|
11
10
|
import { v4 } from 'uuid';
|
|
12
11
|
import auth from '../../../../Auth.js';
|
|
13
12
|
import { CommandError } from '../../../../Command.js';
|
|
@@ -179,12 +178,12 @@ class FileConvertPdfCommand extends GraphCommand {
|
|
|
179
178
|
}
|
|
180
179
|
return fileGraphUrl;
|
|
181
180
|
}
|
|
182
|
-
const _url =
|
|
181
|
+
const _url = new URL(fileWebUrl);
|
|
183
182
|
let siteId = '';
|
|
184
183
|
let driveRelativeFileUrl = '';
|
|
185
|
-
const siteInfo = await this.getGraphSiteInfoFromFullUrl(_url.
|
|
184
|
+
const siteInfo = await this.getGraphSiteInfoFromFullUrl(_url.hostname, _url.pathname);
|
|
186
185
|
siteId = siteInfo.id;
|
|
187
|
-
let siteRelativeFileUrl = _url.
|
|
186
|
+
let siteRelativeFileUrl = _url.pathname.replace(siteInfo.serverRelativeUrl, '');
|
|
188
187
|
// normalize site-relative URLs for root site collections and root sites
|
|
189
188
|
if (!siteRelativeFileUrl.startsWith('/')) {
|
|
190
189
|
siteRelativeFileUrl = '/' + siteRelativeFileUrl;
|
|
@@ -6,7 +6,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _FileAddCommand_instances, _FileAddCommand_initTelemetry, _FileAddCommand_initOptions, _FileAddCommand_initValidators;
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
import path from 'path';
|
|
9
|
-
import url from 'url';
|
|
10
9
|
import request from '../../../request.js';
|
|
11
10
|
import { validation } from '../../../utils/validation.js';
|
|
12
11
|
import GraphCommand from '../../base/GraphCommand.js';
|
|
@@ -28,7 +27,7 @@ class FileAddCommand extends GraphCommand {
|
|
|
28
27
|
async commandAction(logger, args) {
|
|
29
28
|
let folderUrlWithoutTrailingSlash = args.options.folderUrl;
|
|
30
29
|
if (folderUrlWithoutTrailingSlash.endsWith('/')) {
|
|
31
|
-
folderUrlWithoutTrailingSlash = folderUrlWithoutTrailingSlash.
|
|
30
|
+
folderUrlWithoutTrailingSlash = folderUrlWithoutTrailingSlash.substring(0, folderUrlWithoutTrailingSlash.length - 1);
|
|
32
31
|
}
|
|
33
32
|
try {
|
|
34
33
|
const graphFileUrl = await this.getGraphFileUrl(logger, `${folderUrlWithoutTrailingSlash}/${path.basename(args.options.filePath)}`, args.options.siteUrl);
|
|
@@ -97,14 +96,14 @@ class FileAddCommand extends GraphCommand {
|
|
|
97
96
|
if (this.debug) {
|
|
98
97
|
await logger.logToStderr(`Resolving Graph drive item URL for ${fileWebUrl}`);
|
|
99
98
|
}
|
|
100
|
-
const _fileWebUrl =
|
|
101
|
-
const _siteUrl =
|
|
99
|
+
const _fileWebUrl = new URL(fileWebUrl);
|
|
100
|
+
const _siteUrl = new URL(siteUrl || fileWebUrl);
|
|
102
101
|
const isSiteUrl = typeof siteUrl !== 'undefined';
|
|
103
102
|
let siteId = '';
|
|
104
103
|
let driveRelativeFileUrl = '';
|
|
105
|
-
const siteInfo = await this.getGraphSiteInfoFromFullUrl(_siteUrl.host, _siteUrl.
|
|
104
|
+
const siteInfo = await this.getGraphSiteInfoFromFullUrl(_siteUrl.host, _siteUrl.pathname, isSiteUrl);
|
|
106
105
|
siteId = siteInfo.id;
|
|
107
|
-
let siteRelativeFileUrl = _fileWebUrl.
|
|
106
|
+
let siteRelativeFileUrl = _fileWebUrl.pathname.replace(siteInfo.serverRelativeUrl, '');
|
|
108
107
|
// normalize site-relative URLs for root site collections and root sites
|
|
109
108
|
if (!siteRelativeFileUrl.startsWith('/')) {
|
|
110
109
|
siteRelativeFileUrl = '/' + siteRelativeFileUrl;
|
|
@@ -37,6 +37,7 @@ class GraphSubscriptionAddCommand extends GraphCommand {
|
|
|
37
37
|
constructor() {
|
|
38
38
|
super();
|
|
39
39
|
_GraphSubscriptionAddCommand_instances.add(this);
|
|
40
|
+
this.allowedTlsVersions = ['v1_0', 'v1_1', 'v1_2', 'v1_3'];
|
|
40
41
|
__classPrivateFieldGet(this, _GraphSubscriptionAddCommand_instances, "m", _GraphSubscriptionAddCommand_initTelemetry).call(this);
|
|
41
42
|
__classPrivateFieldGet(this, _GraphSubscriptionAddCommand_instances, "m", _GraphSubscriptionAddCommand_initOptions).call(this);
|
|
42
43
|
__classPrivateFieldGet(this, _GraphSubscriptionAddCommand_instances, "m", _GraphSubscriptionAddCommand_initValidators).call(this);
|
|
@@ -46,11 +47,15 @@ class GraphSubscriptionAddCommand extends GraphCommand {
|
|
|
46
47
|
changeType: args.options.changeTypes,
|
|
47
48
|
resource: args.options.resource,
|
|
48
49
|
notificationUrl: args.options.notificationUrl,
|
|
49
|
-
expirationDateTime: await this.getExpirationDateTimeOrDefault(logger, args)
|
|
50
|
+
expirationDateTime: await this.getExpirationDateTimeOrDefault(logger, args),
|
|
51
|
+
clientState: args.options.clientState,
|
|
52
|
+
includeResourceData: args.options.includeResourceData,
|
|
53
|
+
encryptionCertificate: args.options.encryptionCertificate,
|
|
54
|
+
encryptionCertificateId: args.options.encryptionCertificateId,
|
|
55
|
+
lifecycleNotificationUrl: args.options.lifecycleNotificationUrl,
|
|
56
|
+
notificationUrlAppId: args.options.notificationUrlAppId,
|
|
57
|
+
latestSupportedTlsVersion: args.options.latestTLSVersion
|
|
50
58
|
};
|
|
51
|
-
if (args.options.clientState) {
|
|
52
|
-
data["clientState"] = args.options.clientState;
|
|
53
|
-
}
|
|
54
59
|
const requestOptions = {
|
|
55
60
|
url: `${this.resource}/v1.0/subscriptions`,
|
|
56
61
|
headers: {
|
|
@@ -123,7 +128,13 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
123
128
|
Object.assign(this.telemetryProperties, {
|
|
124
129
|
changeTypes: args.options.changeTypes,
|
|
125
130
|
expirationDateTime: typeof args.options.expirationDateTime !== 'undefined',
|
|
126
|
-
clientState: typeof args.options.clientState !== 'undefined'
|
|
131
|
+
clientState: typeof args.options.clientState !== 'undefined',
|
|
132
|
+
lifecycleNotificationUrl: typeof args.options.lifecycleNotificationUrl !== 'undefined',
|
|
133
|
+
notificationUrlAppId: typeof args.options.notificationUrlAppId !== 'undefined',
|
|
134
|
+
latestTLSVersion: typeof args.options.latestTLSVersion !== 'undefined',
|
|
135
|
+
includeResourceData: !!args.options.includeResourceData,
|
|
136
|
+
encryptionCertificate: typeof args.options.encryptionCertificate !== 'undefined',
|
|
137
|
+
encryptionCertificateId: typeof args.options.encryptionCertificateId !== 'undefined'
|
|
127
138
|
});
|
|
128
139
|
});
|
|
129
140
|
}, _GraphSubscriptionAddCommand_initOptions = function _GraphSubscriptionAddCommand_initOptions() {
|
|
@@ -138,6 +149,19 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
138
149
|
option: '-e, --expirationDateTime [expirationDateTime]'
|
|
139
150
|
}, {
|
|
140
151
|
option: '-s, --clientState [clientState]'
|
|
152
|
+
}, {
|
|
153
|
+
option: '--lifecycleNotificationUrl [lifecycleNotificationUrl]'
|
|
154
|
+
}, {
|
|
155
|
+
option: '--notificationUrlAppId [notificationUrlAppId]'
|
|
156
|
+
}, {
|
|
157
|
+
option: '--latestTLSVersion [latestTLSVersion]',
|
|
158
|
+
autocomplete: this.allowedTlsVersions
|
|
159
|
+
}, {
|
|
160
|
+
option: '--includeResourceData [includeResourceData]'
|
|
161
|
+
}, {
|
|
162
|
+
option: '--encryptionCertificate [encryptionCertificate]'
|
|
163
|
+
}, {
|
|
164
|
+
option: '--encryptionCertificateId [encryptionCertificateId]'
|
|
141
165
|
});
|
|
142
166
|
}, _GraphSubscriptionAddCommand_initValidators = function _GraphSubscriptionAddCommand_initValidators() {
|
|
143
167
|
this.validators.push(async (args) => {
|
|
@@ -155,6 +179,23 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
155
179
|
if (args.options.clientState && args.options.clientState.length > 128) {
|
|
156
180
|
return 'The clientState value exceeds the maximum length of 128 characters';
|
|
157
181
|
}
|
|
182
|
+
if (args.options.lifecycleNotificationUrl && !args.options.lifecycleNotificationUrl.toLowerCase().startsWith('https://')
|
|
183
|
+
&& !args.options.lifecycleNotificationUrl.toLowerCase().startsWith('eventhub:https://')
|
|
184
|
+
&& !args.options.lifecycleNotificationUrl.toLowerCase().startsWith('eventgrid:?azuresubscriptionid=')) {
|
|
185
|
+
return `The lifecycle notification URL '${args.options.lifecycleNotificationUrl}' does not start with either 'https://' or 'EventHub:https://' or 'EventGrid:?azuresubscriptionid='`;
|
|
186
|
+
}
|
|
187
|
+
if (args.options.latestTLSVersion && this.allowedTlsVersions.map(x => x.toLowerCase()).indexOf(args.options.latestTLSVersion.toLowerCase()) === -1) {
|
|
188
|
+
return `${args.options.latestTLSVersion} is not a valid TLS version. Allowed values are ${this.allowedTlsVersions.join(', ')}`;
|
|
189
|
+
}
|
|
190
|
+
if (args.options.includeResourceData && !args.options.encryptionCertificate) {
|
|
191
|
+
return `The 'encryptionCertificate' options is required to include the changed resource data`;
|
|
192
|
+
}
|
|
193
|
+
if (args.options.includeResourceData && !args.options.encryptionCertificateId) {
|
|
194
|
+
return `The 'encryptionCertificateId' options is required to include the changed resource data`;
|
|
195
|
+
}
|
|
196
|
+
if (args.options.notificationUrlAppId && !validation.isValidGuid(args.options.notificationUrlAppId)) {
|
|
197
|
+
return `${args.options.notificationUrlAppId} is not a valid GUID for the 'notificationUrlAppId'`;
|
|
198
|
+
}
|
|
158
199
|
return true;
|
|
159
200
|
});
|
|
160
201
|
};
|