@pnp/cli-microsoft365 10.9.0-beta.bc13e90 → 10.10.0-beta.1bb5ba0
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/.devcontainer/Dockerfile +1 -1
- package/.devproxy/api-specs/sharepoint-admin.yaml +67 -0
- package/.devproxy/api-specs/sharepoint.yaml +230 -0
- package/.devproxy/devproxyrc.json +48 -0
- package/.devproxy/generate-openapi-spec.json +24 -0
- package/.devproxy/spo-csom-types.json +54 -0
- package/.eslintrc.cjs +8 -0
- package/Dockerfile +3 -3
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/cli/cli.js +2 -2
- package/dist/m365/app/commands/permission/permission-add.js +8 -1
- package/dist/m365/base/SpoCommand.js +1 -0
- package/dist/m365/entra/commands/app/app-permission-add.js +5 -18
- package/dist/m365/entra/commands/m365group/m365group-get.js +16 -3
- package/dist/m365/entra/commands/m365group/m365group-list.js +7 -1
- package/dist/m365/entra/commands/organization/organization-set.js +104 -0
- package/dist/m365/entra/commands/pim/pim-role-assignment-eligibility-list.js +9 -3
- package/dist/m365/entra/commands/pim/pim-role-assignment-list.js +9 -3
- package/dist/m365/entra/commands/pim/pim-role-request-list.js +9 -3
- package/dist/m365/entra/commands.js +1 -0
- package/dist/m365/file/commands/file-copy.js +2 -2
- package/dist/m365/file/commands/file-move.js +1 -1
- package/dist/m365/flow/commands/flow-list.js +14 -7
- package/dist/m365/flow/commands/run/run-get.js +1 -1
- package/dist/m365/graph/commands/subscription/subscription-add.js +10 -3
- package/dist/m365/planner/commands/tenant/tenant-settings-list.js +0 -3
- package/dist/m365/pp/commands/solution/solution-publisher-list.js +8 -1
- package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +9 -2
- package/dist/m365/spo/commands/contenttype/contenttype-add.js +3 -65
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +5 -50
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +4 -48
- package/dist/m365/spo/commands/contenttype/contenttype-set.js +8 -58
- package/dist/m365/spo/commands/contenttype/contenttype-sync.js +2 -2
- package/dist/m365/spo/commands/file/file-move.js +8 -2
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-set.js +1 -1
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +14 -5
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +9 -2
- package/dist/m365/spo/commands/list/list-view-add.js +140 -87
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +3 -27
- package/dist/m365/spo/commands/page/Page.js +16 -1
- package/dist/m365/spo/commands/page/clientsidepages.js +53 -17
- package/dist/m365/spo/commands/page/page-add.js +1 -1
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +2 -8
- package/dist/m365/spo/commands/page/page-control-remove.js +99 -0
- package/dist/m365/spo/commands/page/page-control-set.js +1 -1
- package/dist/m365/spo/commands/page/page-header-set.js +9 -40
- package/dist/m365/spo/commands/page/page-publish.js +2 -10
- package/dist/m365/spo/commands/page/page-section-add.js +75 -21
- package/dist/m365/spo/commands/page/page-set.js +1 -1
- package/dist/m365/spo/commands/site/site-admin-add.js +1 -12
- package/dist/m365/spo/commands/site/site-set.js +2 -2
- package/dist/m365/spo/commands/tenant/tenant-site-list.js +16 -5
- package/dist/m365/spo/commands/term/term-list.js +10 -3
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/chat/chat-member-add.js +10 -4
- package/dist/m365/viva/commands/engage/engage-community-remove.js +99 -0
- package/dist/m365/viva/commands/engage/engage-network-list.js +8 -2
- package/dist/m365/viva/commands.js +1 -0
- package/dist/utils/entraServicePrincipal.js +21 -0
- package/dist/utils/md.js +3 -3
- package/dist/utils/spo.js +87 -3
- package/docs/docs/cmd/_global.mdx +1 -1
- package/docs/docs/cmd/entra/m365group/m365group-get.mdx +8 -5
- package/docs/docs/cmd/entra/m365group/m365group-list.mdx +14 -12
- package/docs/docs/cmd/entra/organization/organization-set.mdx +84 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-eligibility-list.mdx +7 -4
- package/docs/docs/cmd/entra/pim/pim-role-assignment-list.mdx +9 -6
- package/docs/docs/cmd/entra/pim/pim-role-request-list.mdx +7 -4
- package/docs/docs/cmd/flow/flow-list.mdx +8 -5
- package/docs/docs/cmd/flow/run/run-get.mdx +1 -1
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +6 -3
- package/docs/docs/cmd/planner/bucket/bucket-add.mdx +19 -0
- package/docs/docs/cmd/planner/bucket/bucket-get.mdx +19 -0
- package/docs/docs/cmd/planner/bucket/bucket-list.mdx +19 -0
- package/docs/docs/cmd/planner/bucket/bucket-remove.mdx +21 -0
- package/docs/docs/cmd/planner/bucket/bucket-set.mdx +21 -0
- package/docs/docs/cmd/planner/plan/plan-add.mdx +19 -0
- package/docs/docs/cmd/planner/plan/plan-get.mdx +19 -0
- package/docs/docs/cmd/planner/plan/plan-list.mdx +19 -0
- package/docs/docs/cmd/planner/plan/plan-remove.mdx +21 -0
- package/docs/docs/cmd/planner/plan/plan-set.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-add.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-get.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-add.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-get.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-list.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-remove.mdx +21 -0
- package/docs/docs/cmd/planner/roster/roster-plan-list.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-add.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-add.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-list.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-get.mdx +27 -0
- package/docs/docs/cmd/planner/task/task-list.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-reference-add.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-reference-list.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-reference-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-set.mdx +19 -0
- package/docs/docs/cmd/planner/tenant/tenant-settings-list.mdx +44 -7
- package/docs/docs/cmd/planner/tenant/tenant-settings-set.mdx +43 -8
- package/docs/docs/cmd/pp/solution/solution-publisher-list.mdx +7 -4
- package/docs/docs/cmd/purview/threatassessment/threatassessment-get.mdx +7 -4
- package/docs/docs/cmd/spo/file/file-move.mdx +4 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-get.mdx +6 -3
- package/docs/docs/cmd/spo/hubsite/hubsite-list.mdx +7 -4
- package/docs/docs/cmd/spo/list/list-add.mdx +1 -1
- package/docs/docs/cmd/spo/list/list-set.mdx +2 -2
- package/docs/docs/cmd/spo/list/list-view-add.mdx +53 -10
- package/docs/docs/cmd/spo/page/page-control-remove.mdx +56 -0
- package/docs/docs/cmd/spo/page/page-section-add.mdx +22 -2
- package/docs/docs/cmd/spo/tenant/tenant-site-list.mdx +10 -7
- package/docs/docs/cmd/spo/term/term-list.mdx +7 -4
- package/docs/docs/cmd/teams/chat/chat-member-add.mdx +6 -3
- package/docs/docs/cmd/viva/engage/engage-community-remove.mdx +61 -0
- package/docs/docs/cmd/viva/engage/engage-network-list.mdx +7 -4
- package/npm-shrinkwrap.json +2390 -587
- package/package.json +20 -17
package/dist/cli/cli.js
CHANGED
|
@@ -34,7 +34,7 @@ let currentCommandName;
|
|
|
34
34
|
let optionsFromArgs;
|
|
35
35
|
const defaultHelpMode = 'options';
|
|
36
36
|
const defaultHelpTarget = 'console';
|
|
37
|
-
const helpModes = ['options', 'examples', 'remarks', 'response', 'full'];
|
|
37
|
+
const helpModes = ['options', 'examples', 'remarks', 'permissions', 'response', 'full'];
|
|
38
38
|
const helpTargets = ['console', 'web'];
|
|
39
39
|
const yargsConfiguration = {
|
|
40
40
|
'parse-numbers': true,
|
|
@@ -791,7 +791,7 @@ async function closeWithError(error, args, showHelpIfEnabled = false) {
|
|
|
791
791
|
}
|
|
792
792
|
let errorMessage = error instanceof CommandError ? error.message : error;
|
|
793
793
|
if (error instanceof ZodError) {
|
|
794
|
-
errorMessage = error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(os.EOL);
|
|
794
|
+
errorMessage = error.errors.map(e => (e.path.length > 0 ? `${e.path.join('.')}: ${e.message}` : e.message)).join(os.EOL);
|
|
795
795
|
}
|
|
796
796
|
if ((!args.options.output || args.options.output === 'json') &&
|
|
797
797
|
!cli.getSettingWithDefaultValue(settingsNames.printErrorsAsPlainText, true)) {
|
|
@@ -4,6 +4,7 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
4
4
|
import { odata } from '../../../../utils/odata.js';
|
|
5
5
|
import AppCommand, { appCommandOptions } from '../../../base/AppCommand.js';
|
|
6
6
|
import commands from '../../commands.js';
|
|
7
|
+
import { entraServicePrincipal } from '../../../../utils/entraServicePrincipal.js';
|
|
7
8
|
const options = appCommandOptions
|
|
8
9
|
.extend({
|
|
9
10
|
applicationPermissions: z.string().optional(),
|
|
@@ -58,7 +59,13 @@ class AppPermissionAddCommand extends AppCommand {
|
|
|
58
59
|
};
|
|
59
60
|
await request.patch(addPermissionsRequestOptions);
|
|
60
61
|
if (args.options.grantAdminConsent) {
|
|
61
|
-
|
|
62
|
+
let appServicePrincipal = servicePrincipals.find(sp => sp.appId === this.appId);
|
|
63
|
+
if (!appServicePrincipal) {
|
|
64
|
+
if (this.verbose) {
|
|
65
|
+
await logger.logToStderr(`Creating service principal for app ${this.appId}...`);
|
|
66
|
+
}
|
|
67
|
+
appServicePrincipal = await entraServicePrincipal.createServicePrincipal(this.appId);
|
|
68
|
+
}
|
|
62
69
|
await this.grantAdminConsent(appServicePrincipal, appPermissions, logger);
|
|
63
70
|
}
|
|
64
71
|
}
|
|
@@ -11,6 +11,7 @@ import request from "../../../../request.js";
|
|
|
11
11
|
import { validation } from "../../../../utils/validation.js";
|
|
12
12
|
import { formatting } from "../../../../utils/formatting.js";
|
|
13
13
|
import { cli } from "../../../../cli/cli.js";
|
|
14
|
+
import { entraServicePrincipal } from "../../../../utils/entraServicePrincipal.js";
|
|
14
15
|
var ScopeType;
|
|
15
16
|
(function (ScopeType) {
|
|
16
17
|
ScopeType["Role"] = "Role";
|
|
@@ -58,7 +59,10 @@ class EntraAppPermissionAddCommand extends GraphCommand {
|
|
|
58
59
|
if (args.options.grantAdminConsent) {
|
|
59
60
|
let appServicePrincipal = servicePrincipals.find(sp => sp.appId === appObject.appId);
|
|
60
61
|
if (!appServicePrincipal) {
|
|
61
|
-
|
|
62
|
+
if (this.verbose) {
|
|
63
|
+
await logger.logToStderr(`Creating service principal for app ${appObject.appId}...`);
|
|
64
|
+
}
|
|
65
|
+
appServicePrincipal = await entraServicePrincipal.createServicePrincipal(appObject.appId);
|
|
62
66
|
}
|
|
63
67
|
await this.grantAdminConsent(appServicePrincipal, appPermissions, logger);
|
|
64
68
|
}
|
|
@@ -67,23 +71,6 @@ class EntraAppPermissionAddCommand extends GraphCommand {
|
|
|
67
71
|
this.handleRejectedODataJsonPromise(err);
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
|
-
async createServicePrincipal(appId, logger) {
|
|
71
|
-
if (this.verbose) {
|
|
72
|
-
await logger.logToStderr(`Creating service principal for app ${appId}...`);
|
|
73
|
-
}
|
|
74
|
-
const requestOptions = {
|
|
75
|
-
url: `${this.resource}/v1.0/servicePrincipals`,
|
|
76
|
-
headers: {
|
|
77
|
-
accept: 'application/json;odata.metadata=none',
|
|
78
|
-
'content-type': 'application/json;odata=nometadata'
|
|
79
|
-
},
|
|
80
|
-
data: {
|
|
81
|
-
appId
|
|
82
|
-
},
|
|
83
|
-
responseType: 'json'
|
|
84
|
-
};
|
|
85
|
-
return await request.post(requestOptions);
|
|
86
|
-
}
|
|
87
74
|
async getAppObject(options) {
|
|
88
75
|
let appNotFoundMessage = '';
|
|
89
76
|
let apps = [];
|
|
@@ -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 _EntraM365GroupGetCommand_instances, _EntraM365GroupGetCommand_initOptions, _EntraM365GroupGetCommand_initValidators, _EntraM365GroupGetCommand_initOptionSets, _EntraM365GroupGetCommand_initTypes;
|
|
6
|
+
var _EntraM365GroupGetCommand_instances, _EntraM365GroupGetCommand_initTelemetry, _EntraM365GroupGetCommand_initOptions, _EntraM365GroupGetCommand_initValidators, _EntraM365GroupGetCommand_initOptionSets, _EntraM365GroupGetCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -19,12 +19,16 @@ class EntraM365GroupGetCommand extends GraphCommand {
|
|
|
19
19
|
constructor() {
|
|
20
20
|
super();
|
|
21
21
|
_EntraM365GroupGetCommand_instances.add(this);
|
|
22
|
+
__classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initTelemetry).call(this);
|
|
22
23
|
__classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initOptions).call(this);
|
|
23
24
|
__classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initValidators).call(this);
|
|
24
25
|
__classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initOptionSets).call(this);
|
|
25
26
|
__classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initTypes).call(this);
|
|
26
27
|
}
|
|
27
28
|
async commandAction(logger, args) {
|
|
29
|
+
if (args.options.includeSiteUrl) {
|
|
30
|
+
await this.warn(logger, `Parameter 'includeSiteUrl' is deprecated. Please use 'withSiteUrl' instead`);
|
|
31
|
+
}
|
|
28
32
|
let group;
|
|
29
33
|
try {
|
|
30
34
|
if (args.options.id) {
|
|
@@ -46,7 +50,7 @@ class EntraM365GroupGetCommand extends GraphCommand {
|
|
|
46
50
|
};
|
|
47
51
|
const groupExtended = await request.get(requestExtendedOptions);
|
|
48
52
|
group = { ...group, ...groupExtended };
|
|
49
|
-
if (args.options.includeSiteUrl) {
|
|
53
|
+
if (args.options.includeSiteUrl || args.options.withSiteUrl) {
|
|
50
54
|
const requestOptions = {
|
|
51
55
|
url: `${this.resource}/v1.0/groups/${group.id}/drive?$select=webUrl`,
|
|
52
56
|
headers: {
|
|
@@ -64,13 +68,22 @@ class EntraM365GroupGetCommand extends GraphCommand {
|
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
|
-
_EntraM365GroupGetCommand_instances = new WeakSet(),
|
|
71
|
+
_EntraM365GroupGetCommand_instances = new WeakSet(), _EntraM365GroupGetCommand_initTelemetry = function _EntraM365GroupGetCommand_initTelemetry() {
|
|
72
|
+
this.telemetry.push((args) => {
|
|
73
|
+
Object.assign(this.telemetryProperties, {
|
|
74
|
+
includeSiteUrl: !!args.options.includeSiteUrl,
|
|
75
|
+
withSiteUrl: !!args.options.withSiteUrl
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}, _EntraM365GroupGetCommand_initOptions = function _EntraM365GroupGetCommand_initOptions() {
|
|
68
79
|
this.options.unshift({
|
|
69
80
|
option: '-i, --id [id]'
|
|
70
81
|
}, {
|
|
71
82
|
option: '-n, --displayName [displayName]'
|
|
72
83
|
}, {
|
|
73
84
|
option: '--includeSiteUrl'
|
|
85
|
+
}, {
|
|
86
|
+
option: '--withSiteUrl'
|
|
74
87
|
});
|
|
75
88
|
}, _EntraM365GroupGetCommand_initValidators = function _EntraM365GroupGetCommand_initValidators() {
|
|
76
89
|
this.validators.push(async (args) => {
|
|
@@ -26,6 +26,9 @@ class EntraM365GroupListCommand extends GraphCommand {
|
|
|
26
26
|
return ['id', 'displayName', 'mailNickname', 'siteUrl'];
|
|
27
27
|
}
|
|
28
28
|
async commandAction(logger, args) {
|
|
29
|
+
if (args.options.includeSiteUrl) {
|
|
30
|
+
await this.warn(logger, `Parameter 'includeSiteUrl' is deprecated. Please use 'withSiteUrl' instead`);
|
|
31
|
+
}
|
|
29
32
|
const groupFilter = `?$filter=groupTypes/any(c:c+eq+'Unified')`;
|
|
30
33
|
const displayNameFilter = args.options.displayName ? ` and startswith(DisplayName,'${formatting.encodeQueryParameter(args.options.displayName)}')` : '';
|
|
31
34
|
const mailNicknameFilter = args.options.mailNickname ? ` and startswith(MailNickname,'${formatting.encodeQueryParameter(args.options.mailNickname)}')` : '';
|
|
@@ -43,7 +46,7 @@ class EntraM365GroupListCommand extends GraphCommand {
|
|
|
43
46
|
});
|
|
44
47
|
groups = orphanedGroups;
|
|
45
48
|
}
|
|
46
|
-
if (args.options.includeSiteUrl) {
|
|
49
|
+
if (args.options.includeSiteUrl || args.options.withSiteUrl) {
|
|
47
50
|
const res = await Promise.all(groups.map(g => this.getGroupSiteUrl(g.id)));
|
|
48
51
|
res.forEach(r => {
|
|
49
52
|
for (let i = 0; i < groups.length; i++) {
|
|
@@ -82,6 +85,7 @@ _EntraM365GroupListCommand_instances = new WeakSet(), _EntraM365GroupListCommand
|
|
|
82
85
|
displayName: typeof args.options.displayName !== 'undefined',
|
|
83
86
|
mailNickname: typeof args.options.mailNickname !== 'undefined',
|
|
84
87
|
includeSiteUrl: args.options.includeSiteUrl,
|
|
88
|
+
withSiteUrl: !!args.options.withSiteUrl,
|
|
85
89
|
orphaned: !!args.options.orphaned
|
|
86
90
|
});
|
|
87
91
|
});
|
|
@@ -92,6 +96,8 @@ _EntraM365GroupListCommand_instances = new WeakSet(), _EntraM365GroupListCommand
|
|
|
92
96
|
option: '-m, --mailNickname [displayName]'
|
|
93
97
|
}, {
|
|
94
98
|
option: '--includeSiteUrl'
|
|
99
|
+
}, {
|
|
100
|
+
option: '--withSiteUrl'
|
|
95
101
|
}, {
|
|
96
102
|
option: '--orphaned'
|
|
97
103
|
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import { zod } from '../../../../utils/zod.js';
|
|
4
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
5
|
+
import commands from '../../commands.js';
|
|
6
|
+
import { validation } from '../../../../utils/validation.js';
|
|
7
|
+
import request from '../../../../request.js';
|
|
8
|
+
import { odata } from '../../../../utils/odata.js';
|
|
9
|
+
const options = globalOptionsZod
|
|
10
|
+
.extend({
|
|
11
|
+
id: zod.alias('i', z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
12
|
+
message: `'${id}' is not a valid GUID.`
|
|
13
|
+
})).optional()),
|
|
14
|
+
displayName: zod.alias('d', z.string().optional()),
|
|
15
|
+
marketingNotificationEmails: z.string().refine(emails => validation.isValidUserPrincipalNameArray(emails) === true, invalidEmails => ({
|
|
16
|
+
message: `The following marketing notification emails are invalid: ${invalidEmails}.`
|
|
17
|
+
})).transform((value) => value.split(',')).optional(),
|
|
18
|
+
securityComplianceNotificationMails: z.string().refine(emails => validation.isValidUserPrincipalNameArray(emails) === true, invalidEmails => ({
|
|
19
|
+
message: `The following security compliance notification emails are invalid: ${invalidEmails}.`
|
|
20
|
+
})).transform((value) => value.split(',')).optional(),
|
|
21
|
+
securityComplianceNotificationPhones: z.string().transform((value) => value.split(',')).optional(),
|
|
22
|
+
technicalNotificationMails: z.string().refine(emails => validation.isValidUserPrincipalNameArray(emails) === true, invalidEmails => ({
|
|
23
|
+
message: `The following technical notification emails are invalid: ${invalidEmails}.`
|
|
24
|
+
})).transform((value) => value.split(',')).optional(),
|
|
25
|
+
contactEmail: z.string().refine(id => validation.isValidUserPrincipalName(id), id => ({
|
|
26
|
+
message: `'${id}' is not a valid email.`
|
|
27
|
+
})).optional(),
|
|
28
|
+
statementUrl: z.string().optional()
|
|
29
|
+
})
|
|
30
|
+
.strict();
|
|
31
|
+
class EntraOrganizationSetCommand extends GraphCommand {
|
|
32
|
+
get name() {
|
|
33
|
+
return commands.ORGANIZATION_SET;
|
|
34
|
+
}
|
|
35
|
+
get description() {
|
|
36
|
+
return 'Updates info about the organization';
|
|
37
|
+
}
|
|
38
|
+
get schema() {
|
|
39
|
+
return options;
|
|
40
|
+
}
|
|
41
|
+
getRefinedSchema(schema) {
|
|
42
|
+
return schema
|
|
43
|
+
.refine(options => !(options.id && options.displayName), {
|
|
44
|
+
message: 'Specify either id or displayName, but not both'
|
|
45
|
+
})
|
|
46
|
+
.refine(options => options.id || options.displayName, {
|
|
47
|
+
message: 'Specify either id or displayName'
|
|
48
|
+
})
|
|
49
|
+
.refine(options => [options.contactEmail, options.marketingNotificationEmails, options.securityComplianceNotificationMails, options.securityComplianceNotificationPhones,
|
|
50
|
+
options.statementUrl, options.technicalNotificationMails].filter(o => o !== undefined).length > 0, {
|
|
51
|
+
message: 'Specify at least one of the following options: contactEmail, marketingNotificationEmails, securityComplianceNotificationMails, securityComplianceNotificationPhones, statementUrl, or technicalNotificationMails'
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
async commandAction(logger, args) {
|
|
55
|
+
try {
|
|
56
|
+
let organizationId = args.options.id;
|
|
57
|
+
if (args.options.displayName) {
|
|
58
|
+
organizationId = await this.getOrganizationIdByDisplayName(args.options.displayName);
|
|
59
|
+
}
|
|
60
|
+
if (args.options.verbose) {
|
|
61
|
+
await logger.logToStderr(`Updating organization with ID ${organizationId}...`);
|
|
62
|
+
}
|
|
63
|
+
const data = {
|
|
64
|
+
marketingNotificationEmails: args.options.marketingNotificationEmails,
|
|
65
|
+
securityComplianceNotificationMails: args.options.securityComplianceNotificationMails,
|
|
66
|
+
securityComplianceNotificationPhones: args.options.securityComplianceNotificationPhones,
|
|
67
|
+
technicalNotificationMails: args.options.technicalNotificationMails
|
|
68
|
+
};
|
|
69
|
+
if (args.options.contactEmail || args.options.statementUrl) {
|
|
70
|
+
data.privacyProfile = {};
|
|
71
|
+
}
|
|
72
|
+
if (args.options.contactEmail) {
|
|
73
|
+
data.privacyProfile.contactEmail = args.options.contactEmail;
|
|
74
|
+
}
|
|
75
|
+
if (args.options.statementUrl) {
|
|
76
|
+
data.privacyProfile.statementUrl = args.options.statementUrl;
|
|
77
|
+
}
|
|
78
|
+
const requestOptions = {
|
|
79
|
+
url: `${this.resource}/v1.0/organization/${organizationId}`,
|
|
80
|
+
headers: {
|
|
81
|
+
accept: 'application/json;odata.metadata=none',
|
|
82
|
+
'content-type': 'application/json'
|
|
83
|
+
},
|
|
84
|
+
data: data,
|
|
85
|
+
responseType: 'json'
|
|
86
|
+
};
|
|
87
|
+
await request.patch(requestOptions);
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
this.handleRejectedODataJsonPromise(err);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async getOrganizationIdByDisplayName(displayName) {
|
|
94
|
+
const url = `${this.resource}/v1.0/organization?$select=id,displayName`;
|
|
95
|
+
// the endpoint always returns one item
|
|
96
|
+
const organizations = await odata.getAllItems(url);
|
|
97
|
+
if (organizations[0].displayName !== displayName) {
|
|
98
|
+
throw `The specified organization '${displayName}' does not exist.`;
|
|
99
|
+
}
|
|
100
|
+
return organizations[0].id;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export default new EntraOrganizationSetCommand();
|
|
104
|
+
//# sourceMappingURL=organization-set.js.map
|
|
@@ -29,6 +29,9 @@ class EntraPimRoleAssignmentEligibilityListCommand extends GraphCommand {
|
|
|
29
29
|
__classPrivateFieldGet(this, _EntraPimRoleAssignmentEligibilityListCommand_instances, "m", _EntraPimRoleAssignmentEligibilityListCommand_initOptionSets).call(this);
|
|
30
30
|
}
|
|
31
31
|
async commandAction(logger, args) {
|
|
32
|
+
if (args.options.includePrincipalDetails) {
|
|
33
|
+
await this.warn(logger, `Parameter 'includePrincipalDetails' is deprecated. Please use 'withPrincipalDetails' instead`);
|
|
34
|
+
}
|
|
32
35
|
if (this.verbose) {
|
|
33
36
|
await logger.logToStderr(`Retrieving list of eligible roles for ${args.options.userId || args.options.userName || args.options.groupId || args.options.groupName || 'all users'}...`);
|
|
34
37
|
}
|
|
@@ -40,7 +43,7 @@ class EntraPimRoleAssignmentEligibilityListCommand extends GraphCommand {
|
|
|
40
43
|
queryParameters.push(`$filter=principalId eq '${principalId}'`);
|
|
41
44
|
}
|
|
42
45
|
expands.push('roleDefinition($select=displayName)');
|
|
43
|
-
if (args.options.includePrincipalDetails) {
|
|
46
|
+
if (args.options.includePrincipalDetails || args.options.withPrincipalDetails) {
|
|
44
47
|
expands.push('principal');
|
|
45
48
|
}
|
|
46
49
|
queryParameters.push(`$expand=${expands.join(',')}`);
|
|
@@ -86,7 +89,8 @@ _EntraPimRoleAssignmentEligibilityListCommand_instances = new WeakSet(), _EntraP
|
|
|
86
89
|
userName: typeof args.options.userName !== 'undefined',
|
|
87
90
|
groupId: typeof args.options.groupId !== 'undefined',
|
|
88
91
|
groupName: typeof args.options.groupName !== 'undefined',
|
|
89
|
-
includePrincipalDetails: !!args.options.includePrincipalDetails
|
|
92
|
+
includePrincipalDetails: !!args.options.includePrincipalDetails,
|
|
93
|
+
withPrincipalDetails: !!args.options.withPrincipalDetails
|
|
90
94
|
});
|
|
91
95
|
});
|
|
92
96
|
}, _EntraPimRoleAssignmentEligibilityListCommand_initOptions = function _EntraPimRoleAssignmentEligibilityListCommand_initOptions() {
|
|
@@ -99,7 +103,9 @@ _EntraPimRoleAssignmentEligibilityListCommand_instances = new WeakSet(), _EntraP
|
|
|
99
103
|
}, {
|
|
100
104
|
option: '--groupName [groupName]'
|
|
101
105
|
}, {
|
|
102
|
-
option: '--includePrincipalDetails
|
|
106
|
+
option: '--includePrincipalDetails'
|
|
107
|
+
}, {
|
|
108
|
+
option: '--withPrincipalDetails'
|
|
103
109
|
});
|
|
104
110
|
}, _EntraPimRoleAssignmentEligibilityListCommand_initValidators = function _EntraPimRoleAssignmentEligibilityListCommand_initValidators() {
|
|
105
111
|
this.validators.push(async (args) => {
|
|
@@ -30,6 +30,9 @@ class EntraPimRoleAssignmentListCommand extends GraphCommand {
|
|
|
30
30
|
const filters = [];
|
|
31
31
|
const expands = [];
|
|
32
32
|
try {
|
|
33
|
+
if (args.options.includePrincipalDetails) {
|
|
34
|
+
await this.warn(logger, `Parameter 'includePrincipalDetails' is deprecated. Please use 'withPrincipalDetails' instead`);
|
|
35
|
+
}
|
|
33
36
|
const principalId = await this.getPrincipalId(logger, args.options);
|
|
34
37
|
if (principalId) {
|
|
35
38
|
filters.push(`principalId eq '${principalId}'`);
|
|
@@ -41,7 +44,7 @@ class EntraPimRoleAssignmentListCommand extends GraphCommand {
|
|
|
41
44
|
queryParameters.push(`$filter=${filters.join(' and ')}`);
|
|
42
45
|
}
|
|
43
46
|
expands.push('roleDefinition($select=displayName)');
|
|
44
|
-
if (args.options.includePrincipalDetails) {
|
|
47
|
+
if (args.options.includePrincipalDetails || args.options.withPrincipalDetails) {
|
|
45
48
|
expands.push('principal');
|
|
46
49
|
}
|
|
47
50
|
queryParameters.push(`$expand=${expands.join(',')}`);
|
|
@@ -82,7 +85,8 @@ _EntraPimRoleAssignmentListCommand_instances = new WeakSet(), _EntraPimRoleAssig
|
|
|
82
85
|
groupId: typeof args.options.groupId !== 'undefined',
|
|
83
86
|
groupName: typeof args.options.groupName !== 'undefined',
|
|
84
87
|
startDateTime: typeof args.options.startDateTime !== 'undefined',
|
|
85
|
-
includePrincipalDetails: !!args.options.includePrincipalDetails
|
|
88
|
+
includePrincipalDetails: !!args.options.includePrincipalDetails,
|
|
89
|
+
withPrincipalDetails: !!args.options.withPrincipalDetails
|
|
86
90
|
});
|
|
87
91
|
});
|
|
88
92
|
}, _EntraPimRoleAssignmentListCommand_initOptions = function _EntraPimRoleAssignmentListCommand_initOptions() {
|
|
@@ -97,7 +101,9 @@ _EntraPimRoleAssignmentListCommand_instances = new WeakSet(), _EntraPimRoleAssig
|
|
|
97
101
|
}, {
|
|
98
102
|
option: "-s, --startDateTime [startDateTime]"
|
|
99
103
|
}, {
|
|
100
|
-
option: "--includePrincipalDetails
|
|
104
|
+
option: "--includePrincipalDetails"
|
|
105
|
+
}, {
|
|
106
|
+
option: "--withPrincipalDetails"
|
|
101
107
|
});
|
|
102
108
|
}, _EntraPimRoleAssignmentListCommand_initValidators = function _EntraPimRoleAssignmentListCommand_initValidators() {
|
|
103
109
|
this.validators.push(async (args) => {
|
|
@@ -30,6 +30,9 @@ class EntraPimRoleRequestListCommand extends GraphCommand {
|
|
|
30
30
|
__classPrivateFieldGet(this, _EntraPimRoleRequestListCommand_instances, "m", _EntraPimRoleRequestListCommand_initOptionSets).call(this);
|
|
31
31
|
}
|
|
32
32
|
async commandAction(logger, args) {
|
|
33
|
+
if (args.options.includePrincipalDetails) {
|
|
34
|
+
await this.warn(logger, `Parameter 'includePrincipalDetails' is deprecated. Please use 'withPrincipalDetails' instead`);
|
|
35
|
+
}
|
|
33
36
|
if (this.verbose) {
|
|
34
37
|
await logger.logToStderr(`Retrieving list of PIM roles requests for ${args.options.userId || args.options.userName || args.options.groupId || args.options.groupName || 'all users'}...`);
|
|
35
38
|
}
|
|
@@ -51,7 +54,7 @@ class EntraPimRoleRequestListCommand extends GraphCommand {
|
|
|
51
54
|
queryParameters.push(`$filter=${filters.join(' and ')}`);
|
|
52
55
|
}
|
|
53
56
|
expands.push('roleDefinition($select=displayName)');
|
|
54
|
-
if (args.options.includePrincipalDetails) {
|
|
57
|
+
if (args.options.includePrincipalDetails || args.options.withPrincipalDetails) {
|
|
55
58
|
expands.push('principal');
|
|
56
59
|
}
|
|
57
60
|
queryParameters.push(`$expand=${expands.join(',')}`);
|
|
@@ -100,7 +103,8 @@ _EntraPimRoleRequestListCommand_instances = new WeakSet(), _EntraPimRoleRequestL
|
|
|
100
103
|
groupName: typeof args.options.groupName !== 'undefined',
|
|
101
104
|
createdDateTime: typeof args.options.createdDateTime !== 'undefined',
|
|
102
105
|
status: typeof args.options.status !== 'undefined',
|
|
103
|
-
includePrincipalDetails: !!args.options.includePrincipalDetails
|
|
106
|
+
includePrincipalDetails: !!args.options.includePrincipalDetails,
|
|
107
|
+
withPrincipalDetails: !!args.options.withPrincipalDetails
|
|
104
108
|
});
|
|
105
109
|
});
|
|
106
110
|
}, _EntraPimRoleRequestListCommand_initOptions = function _EntraPimRoleRequestListCommand_initOptions() {
|
|
@@ -118,7 +122,9 @@ _EntraPimRoleRequestListCommand_instances = new WeakSet(), _EntraPimRoleRequestL
|
|
|
118
122
|
option: '-s, --status [status]',
|
|
119
123
|
autocomplete: this.allowedStatuses
|
|
120
124
|
}, {
|
|
121
|
-
option: '--includePrincipalDetails
|
|
125
|
+
option: '--includePrincipalDetails'
|
|
126
|
+
}, {
|
|
127
|
+
option: '--withPrincipalDetails'
|
|
122
128
|
});
|
|
123
129
|
}, _EntraPimRoleRequestListCommand_initValidators = function _EntraPimRoleRequestListCommand_initValidators() {
|
|
124
130
|
this.validators.push(async (args) => {
|
|
@@ -84,6 +84,7 @@ export default {
|
|
|
84
84
|
OAUTH2GRANT_REMOVE: `${prefix} oauth2grant remove`,
|
|
85
85
|
OAUTH2GRANT_SET: `${prefix} oauth2grant set`,
|
|
86
86
|
ORGANIZATION_LIST: `${prefix} organization list`,
|
|
87
|
+
ORGANIZATION_SET: `${prefix} organization set`,
|
|
87
88
|
PIM_ROLE_ASSIGNMENT_ADD: `${prefix} pim role assignment add`,
|
|
88
89
|
PIM_ROLE_ASSIGNMENT_LIST: `${prefix} pim role assignment list`,
|
|
89
90
|
PIM_ROLE_ASSIGNMENT_REMOVE: `${prefix} pim role assignment remove`,
|
|
@@ -63,7 +63,7 @@ class FileCopyCommand extends GraphCommand {
|
|
|
63
63
|
async getCopyUrl(options, sourcePath, logger) {
|
|
64
64
|
const { webUrl, sourceUrl, verbose, nameConflictBehavior } = options;
|
|
65
65
|
const folderUrl = new URL(sourcePath);
|
|
66
|
-
const siteId = await spo.
|
|
66
|
+
const siteId = await spo.getSiteIdByMSGraph(webUrl, logger, verbose);
|
|
67
67
|
const drive = await this.getDocumentLibrary(siteId, folderUrl, sourceUrl, logger);
|
|
68
68
|
const itemId = await this.getStartingFolderId(drive, folderUrl, logger);
|
|
69
69
|
const queryParameters = nameConflictBehavior && nameConflictBehavior !== 'fail'
|
|
@@ -74,7 +74,7 @@ class FileCopyCommand extends GraphCommand {
|
|
|
74
74
|
}
|
|
75
75
|
async getTargetDriveAndItemId(webUrl, targetUrl, logger, verbose) {
|
|
76
76
|
const targetSiteUrl = urlUtil.getTargetSiteAbsoluteUrl(webUrl, targetUrl);
|
|
77
|
-
const targetSiteId = await spo.
|
|
77
|
+
const targetSiteId = await spo.getSiteIdByMSGraph(targetSiteUrl, logger, verbose);
|
|
78
78
|
const targetFolderUrl = new URL(this.getAbsoluteUrl(targetSiteUrl, targetUrl));
|
|
79
79
|
const targetDrive = await this.getDocumentLibrary(targetSiteId, targetFolderUrl, targetUrl, logger);
|
|
80
80
|
const targetDriveId = targetDrive.id;
|
|
@@ -59,7 +59,7 @@ class FileMoveCommand extends GraphCommand {
|
|
|
59
59
|
return url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
|
|
60
60
|
}
|
|
61
61
|
async getDriveIdAndItemId(webUrl, folderUrl, sourceUrl, logger, verbose) {
|
|
62
|
-
const siteId = await spo.
|
|
62
|
+
const siteId = await spo.getSiteIdByMSGraph(webUrl, logger, verbose);
|
|
63
63
|
const driveDetails = await drive.getDriveByUrl(siteId, new URL(folderUrl), logger, verbose);
|
|
64
64
|
const itemId = await drive.getDriveItemId(driveDetails, new URL(folderUrl), logger, verbose);
|
|
65
65
|
return { driveId: driveDetails.id, itemId };
|
|
@@ -28,29 +28,33 @@ class FlowListCommand extends PowerAutomateCommand {
|
|
|
28
28
|
__classPrivateFieldGet(this, _FlowListCommand_instances, "m", _FlowListCommand_initTypes).call(this);
|
|
29
29
|
}
|
|
30
30
|
async commandAction(logger, args) {
|
|
31
|
+
if (args.options.includeSolutions) {
|
|
32
|
+
await this.warn(logger, `Parameter 'includeSolutions' is deprecated. Please use 'withSolutions' instead`);
|
|
33
|
+
}
|
|
31
34
|
if (this.verbose) {
|
|
32
35
|
await logger.logToStderr(`Getting Power Automate flows${args.options.asAdmin ? ' as admin' : ''} in environment '${args.options.environmentName}'...`);
|
|
33
36
|
}
|
|
34
37
|
try {
|
|
35
|
-
const { environmentName, asAdmin, sharingStatus, includeSolutions } = args.options;
|
|
38
|
+
const { environmentName, asAdmin, sharingStatus, includeSolutions, withSolutions } = args.options;
|
|
36
39
|
let items = [];
|
|
40
|
+
const shouldIncludeSolutions = withSolutions || includeSolutions;
|
|
37
41
|
if (sharingStatus === 'personal') {
|
|
38
|
-
const url = this.getApiUrl(environmentName, asAdmin,
|
|
42
|
+
const url = this.getApiUrl(environmentName, asAdmin, shouldIncludeSolutions, 'personal');
|
|
39
43
|
items = await odata.getAllItems(url);
|
|
40
44
|
}
|
|
41
45
|
else if (sharingStatus === 'sharedWithMe') {
|
|
42
|
-
const url = this.getApiUrl(environmentName, asAdmin,
|
|
46
|
+
const url = this.getApiUrl(environmentName, asAdmin, shouldIncludeSolutions, 'team');
|
|
43
47
|
items = await odata.getAllItems(url);
|
|
44
48
|
}
|
|
45
49
|
else if (sharingStatus === 'all') {
|
|
46
|
-
let url = this.getApiUrl(environmentName, asAdmin,
|
|
50
|
+
let url = this.getApiUrl(environmentName, asAdmin, shouldIncludeSolutions, 'personal');
|
|
47
51
|
items = await odata.getAllItems(url);
|
|
48
|
-
url = this.getApiUrl(environmentName, asAdmin,
|
|
52
|
+
url = this.getApiUrl(environmentName, asAdmin, shouldIncludeSolutions, 'team');
|
|
49
53
|
const teamFlows = await odata.getAllItems(url);
|
|
50
54
|
items = items.concat(teamFlows);
|
|
51
55
|
}
|
|
52
56
|
else {
|
|
53
|
-
const url = this.getApiUrl(environmentName, asAdmin,
|
|
57
|
+
const url = this.getApiUrl(environmentName, asAdmin, shouldIncludeSolutions);
|
|
54
58
|
items = await odata.getAllItems(url);
|
|
55
59
|
}
|
|
56
60
|
// Remove duplicates
|
|
@@ -81,6 +85,7 @@ _FlowListCommand_instances = new WeakSet(), _FlowListCommand_initTelemetry = fun
|
|
|
81
85
|
Object.assign(this.telemetryProperties, {
|
|
82
86
|
sharingStatus: typeof args.options.sharingStatus !== 'undefined',
|
|
83
87
|
includeSolutions: !!args.options.includeSolutions,
|
|
88
|
+
withSolutions: !!args.options.withSolutions,
|
|
84
89
|
asAdmin: !!args.options.asAdmin
|
|
85
90
|
});
|
|
86
91
|
});
|
|
@@ -92,6 +97,8 @@ _FlowListCommand_instances = new WeakSet(), _FlowListCommand_initTelemetry = fun
|
|
|
92
97
|
autocomplete: this.allowedSharingStatuses
|
|
93
98
|
}, {
|
|
94
99
|
option: '--includeSolutions'
|
|
100
|
+
}, {
|
|
101
|
+
option: '--withSolutions'
|
|
95
102
|
}, {
|
|
96
103
|
option: '--asAdmin'
|
|
97
104
|
});
|
|
@@ -107,7 +114,7 @@ _FlowListCommand_instances = new WeakSet(), _FlowListCommand_initTelemetry = fun
|
|
|
107
114
|
});
|
|
108
115
|
}, _FlowListCommand_initTypes = function _FlowListCommand_initTypes() {
|
|
109
116
|
this.types.string.push('environmentName', 'sharingStatus');
|
|
110
|
-
this.types.boolean.push('includeSolutions', 'asAdmin');
|
|
117
|
+
this.types.boolean.push('includeSolutions', 'withSolutions', 'asAdmin');
|
|
111
118
|
};
|
|
112
119
|
export default new FlowListCommand();
|
|
113
120
|
//# sourceMappingURL=flow-list.js.map
|
|
@@ -28,7 +28,7 @@ class FlowRunGetCommand extends PowerAutomateCommand {
|
|
|
28
28
|
await logger.logToStderr(`Retrieving information about run ${args.options.name} of Microsoft Flow ${args.options.flowName}...`);
|
|
29
29
|
}
|
|
30
30
|
if (args.options.includeTriggerInformation) {
|
|
31
|
-
await this.warn(logger, `Parameter 'includeTriggerInformation' is deprecated. Please use 'withTrigger instead`);
|
|
31
|
+
await this.warn(logger, `Parameter 'includeTriggerInformation' is deprecated. Please use 'withTrigger' instead`);
|
|
32
32
|
}
|
|
33
33
|
const actionsParameter = args.options.withActions ? '$expand=properties%2Factions&' : '';
|
|
34
34
|
const requestOptions = {
|
|
@@ -49,7 +49,7 @@ class GraphSubscriptionAddCommand extends GraphCommand {
|
|
|
49
49
|
notificationUrl: args.options.notificationUrl,
|
|
50
50
|
expirationDateTime: await this.getExpirationDateTimeOrDefault(logger, args),
|
|
51
51
|
clientState: args.options.clientState,
|
|
52
|
-
includeResourceData: args.options.includeResourceData,
|
|
52
|
+
includeResourceData: args.options.withResourceData || args.options.includeResourceData,
|
|
53
53
|
encryptionCertificate: args.options.encryptionCertificate,
|
|
54
54
|
encryptionCertificateId: args.options.encryptionCertificateId,
|
|
55
55
|
lifecycleNotificationUrl: args.options.lifecycleNotificationUrl,
|
|
@@ -66,6 +66,9 @@ class GraphSubscriptionAddCommand extends GraphCommand {
|
|
|
66
66
|
responseType: 'json'
|
|
67
67
|
};
|
|
68
68
|
try {
|
|
69
|
+
if (args.options.includeResourceData) {
|
|
70
|
+
await this.warn(logger, `Parameter 'includeResourceData' is deprecated. Please use 'withResourceData' instead`);
|
|
71
|
+
}
|
|
69
72
|
const res = await request.post(requestOptions);
|
|
70
73
|
await logger.log(res);
|
|
71
74
|
}
|
|
@@ -133,6 +136,7 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
133
136
|
notificationUrlAppId: typeof args.options.notificationUrlAppId !== 'undefined',
|
|
134
137
|
latestTLSVersion: typeof args.options.latestTLSVersion !== 'undefined',
|
|
135
138
|
includeResourceData: !!args.options.includeResourceData,
|
|
139
|
+
withResourceData: !!args.options.withResourceData,
|
|
136
140
|
encryptionCertificate: typeof args.options.encryptionCertificate !== 'undefined',
|
|
137
141
|
encryptionCertificateId: typeof args.options.encryptionCertificateId !== 'undefined'
|
|
138
142
|
});
|
|
@@ -158,6 +162,8 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
158
162
|
autocomplete: this.allowedTlsVersions
|
|
159
163
|
}, {
|
|
160
164
|
option: '--includeResourceData [includeResourceData]'
|
|
165
|
+
}, {
|
|
166
|
+
option: '--withResourceData [withResourceData]'
|
|
161
167
|
}, {
|
|
162
168
|
option: '--encryptionCertificate [encryptionCertificate]'
|
|
163
169
|
}, {
|
|
@@ -187,10 +193,11 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
187
193
|
if (args.options.latestTLSVersion && this.allowedTlsVersions.map(x => x.toLowerCase()).indexOf(args.options.latestTLSVersion.toLowerCase()) === -1) {
|
|
188
194
|
return `${args.options.latestTLSVersion} is not a valid TLS version. Allowed values are ${this.allowedTlsVersions.join(', ')}`;
|
|
189
195
|
}
|
|
190
|
-
|
|
196
|
+
const shouldIncludeResourceData = args.options.includeResourceData || args.options.withResourceData;
|
|
197
|
+
if (shouldIncludeResourceData && !args.options.encryptionCertificate) {
|
|
191
198
|
return `The 'encryptionCertificate' options is required to include the changed resource data`;
|
|
192
199
|
}
|
|
193
|
-
if (
|
|
200
|
+
if (shouldIncludeResourceData && !args.options.encryptionCertificateId) {
|
|
194
201
|
return `The 'encryptionCertificateId' options is required to include the changed resource data`;
|
|
195
202
|
}
|
|
196
203
|
if (args.options.notificationUrlAppId && !validation.isValidGuid(args.options.notificationUrlAppId)) {
|
|
@@ -8,9 +8,6 @@ class PlannerTenantSettingsListCommand extends PlannerCommand {
|
|
|
8
8
|
get description() {
|
|
9
9
|
return 'Lists the Microsoft Planner configuration of the tenant';
|
|
10
10
|
}
|
|
11
|
-
defaultProperties() {
|
|
12
|
-
return ['isPlannerAllowed', 'allowCalendarSharing', 'allowTenantMoveWithDataLoss', 'allowTenantMoveWithDataMigration', 'allowRosterCreation', 'allowPlannerMobilePushNotifications'];
|
|
13
|
-
}
|
|
14
11
|
async commandAction(logger) {
|
|
15
12
|
const requestOptions = {
|
|
16
13
|
url: `${this.resource}/taskAPI/tenantAdminSettings/Settings`,
|
|
@@ -25,13 +25,17 @@ class PpSolutionPublisherListCommand extends PowerPlatformCommand {
|
|
|
25
25
|
__classPrivateFieldGet(this, _PpSolutionPublisherListCommand_instances, "m", _PpSolutionPublisherListCommand_initOptions).call(this);
|
|
26
26
|
}
|
|
27
27
|
async commandAction(logger, args) {
|
|
28
|
+
if (args.options.includeMicrosoftPublishers) {
|
|
29
|
+
await this.warn(logger, `Parameter 'includeMicrosoftPublishers' is deprecated. Please use 'withMicrosoftPublishers' instead`);
|
|
30
|
+
}
|
|
28
31
|
if (this.verbose) {
|
|
29
32
|
await logger.logToStderr(`Retrieving list of publishers...`);
|
|
30
33
|
}
|
|
31
34
|
try {
|
|
32
35
|
const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin);
|
|
36
|
+
const shouldIncludeMicrosoftPublishers = args.options.withMicrosoftPublishers || args.options.includeMicrosoftPublishers;
|
|
33
37
|
const requestOptions = {
|
|
34
|
-
url: `${dynamicsApiUrl}/api/data/v9.0/publishers?$select=publisherid,uniquename,friendlyname,versionnumber,isreadonly,description,customizationprefix,customizationoptionvalueprefix${!
|
|
38
|
+
url: `${dynamicsApiUrl}/api/data/v9.0/publishers?$select=publisherid,uniquename,friendlyname,versionnumber,isreadonly,description,customizationprefix,customizationoptionvalueprefix${!shouldIncludeMicrosoftPublishers ? `&$filter=publisherid ne 'd21aab70-79e7-11dd-8874-00188b01e34f'` : ''}&api-version=9.1`,
|
|
35
39
|
headers: {
|
|
36
40
|
accept: 'application/json;odata.metadata=none'
|
|
37
41
|
},
|
|
@@ -49,6 +53,7 @@ _PpSolutionPublisherListCommand_instances = new WeakSet(), _PpSolutionPublisherL
|
|
|
49
53
|
this.telemetry.push((args) => {
|
|
50
54
|
Object.assign(this.telemetryProperties, {
|
|
51
55
|
includeMicrosoftPublishers: typeof args.options.includeMicrosoftPublishers !== 'undefined',
|
|
56
|
+
withMicrosoftPublishers: typeof args.options.withMicrosoftPublishers !== 'undefined',
|
|
52
57
|
asAdmin: !!args.options.asAdmin
|
|
53
58
|
});
|
|
54
59
|
});
|
|
@@ -57,6 +62,8 @@ _PpSolutionPublisherListCommand_instances = new WeakSet(), _PpSolutionPublisherL
|
|
|
57
62
|
option: '-e, --environmentName <environmentName>'
|
|
58
63
|
}, {
|
|
59
64
|
option: '--includeMicrosoftPublishers'
|
|
65
|
+
}, {
|
|
66
|
+
option: '--withMicrosoftPublishers'
|
|
60
67
|
}, {
|
|
61
68
|
option: '--asAdmin'
|
|
62
69
|
});
|