@pnp/cli-microsoft365 7.0.0-beta.c0afb7b → 7.0.0-beta.c2db9df
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/README.md +4 -4
- package/dist/cli/Cli.js +3 -3
- package/dist/m365/aad/commands/app/app-add.js +8 -8
- package/dist/m365/aad/commands/app/app-get.js +4 -1
- package/dist/m365/aad/commands/app/app-remove.js +3 -1
- package/dist/m365/aad/commands/app/app-role-add.js +9 -6
- package/dist/m365/aad/commands/app/app-role-list.js +4 -1
- package/dist/m365/aad/commands/app/app-role-remove.js +5 -2
- package/dist/m365/aad/commands/app/app-set.js +9 -6
- package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +7 -2
- package/dist/m365/aad/commands/group/group-get.js +4 -4
- package/dist/m365/aad/commands/group/group-list.js +1 -23
- package/dist/m365/aad/commands/m365group/m365group-add.js +12 -9
- package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-remove.js +3 -1
- package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-restore.js +4 -1
- package/dist/m365/aad/commands/m365group/m365group-teamify.js +4 -1
- package/dist/m365/aad/commands/policy/policy-list.js +5 -5
- package/dist/m365/aad/commands/sp/sp-add.js +4 -1
- package/dist/m365/aad/commands/sp/sp-get.js +4 -1
- package/dist/m365/aad/commands/user/user-get.js +7 -2
- package/dist/m365/booking/commands/business/business-get.js +4 -1
- package/dist/m365/cli/commands/cli-issue.js +5 -5
- package/dist/m365/cli/commands/config/config-get.js +5 -5
- package/dist/m365/cli/commands/config/config-reset.js +5 -5
- package/dist/m365/cli/commands/config/config-set.js +5 -5
- package/dist/m365/commands/login.js +5 -5
- package/dist/m365/commands/request.js +1 -1
- package/dist/m365/flow/commands/owner/owner-ensure.js +5 -5
- package/dist/m365/outlook/commands/message/message-list.js +4 -2
- package/dist/m365/outlook/commands/message/message-move.js +4 -2
- package/dist/m365/pa/commands/app/app-export.js +7 -7
- package/dist/m365/pa/commands/app/app-owner-set.js +5 -5
- package/dist/m365/pa/commands/app/app-permission-ensure.js +5 -5
- package/dist/m365/planner/commands/bucket/bucket-get.js +5 -1
- package/dist/m365/planner/commands/bucket/bucket-remove.js +3 -1
- package/dist/m365/planner/commands/bucket/bucket-set.js +4 -1
- package/dist/m365/planner/commands/task/task-add.js +17 -11
- package/dist/m365/planner/commands/task/task-get.js +42 -27
- package/dist/m365/planner/commands/task/task-list.js +26 -19
- package/dist/m365/planner/commands/task/task-remove.js +45 -37
- package/dist/m365/planner/commands/task/task-set.js +35 -23
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-get.js +4 -1
- package/dist/m365/pp/commands/card/card-get.js +3 -5
- package/dist/m365/pp/commands/chatbot/chatbot-get.js +3 -1
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +4 -1
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +14 -14
- package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +3 -1
- package/dist/m365/spfx/commands/package/package-generate.js +15 -15
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +55 -0
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.5.js → doctor-1.18.0-rc.1.js} +2 -2
- package/dist/m365/spfx/commands/project/project-doctor.js +9 -9
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +157 -0
- package/dist/m365/spfx/commands/project/project-github-workflow-model.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002028_DEVDEP_microsoft_rush_stack_compiler_4_7.js +13 -0
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.18.0-beta.5.js → upgrade-1.18.0-rc.1.js} +35 -27
- package/dist/m365/spfx/commands/project/project-upgrade.js +14 -14
- package/dist/m365/spfx/commands/spfx-doctor.js +3 -3
- package/dist/m365/spfx/commands.js +1 -0
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +5 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +5 -3
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +5 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +2 -2
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +3 -2
- package/dist/m365/spo/commands/commandset/commandset-add.js +11 -11
- package/dist/m365/spo/commands/commandset/commandset-get.js +12 -10
- package/dist/m365/spo/commands/commandset/commandset-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-remove.js +7 -6
- package/dist/m365/spo/commands/commandset/commandset-set.js +14 -12
- package/dist/m365/spo/commands/customaction/customaction-get.js +5 -2
- package/dist/m365/spo/commands/customaction/customaction-remove.js +3 -1
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +3 -1
- package/dist/m365/spo/commands/file/file-get.js +9 -6
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +8 -8
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +5 -5
- package/dist/m365/spo/commands/hubsite/hubsite-connect.js +7 -4
- package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +4 -1
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +3 -1
- package/dist/m365/spo/commands/list/list-add.js +4 -4
- package/dist/m365/spo/commands/list/list-set.js +4 -4
- package/dist/m365/spo/commands/listitem/listitem-add.js +1 -0
- package/dist/m365/spo/commands/listitem/listitem-set.js +3 -2
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +8 -8
- package/dist/m365/spo/commands/page/clientsidepages.js +18 -0
- package/dist/m365/spo/commands/page/page-get.js +1 -0
- package/dist/m365/spo/commands/page/page-list.js +4 -3
- package/dist/m365/spo/commands/page/page-section-add.js +56 -21
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +30 -32
- package/dist/m365/spo/commands/site/site-add.js +114 -161
- package/dist/m365/spo/commands/site/site-apppermission-add.js +15 -18
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +34 -38
- package/dist/m365/spo/commands/site/site-apppermission-set.js +11 -14
- package/dist/m365/spo/commands/site/site-ensure.js +13 -66
- package/dist/m365/spo/commands/site/site-list.js +5 -7
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +6 -6
- package/dist/m365/spo/commands/site/site-remove.js +166 -210
- package/dist/m365/spo/commands/site/site-set.js +121 -153
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +8 -3
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +2 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +8 -3
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +3 -1
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +4 -4
- package/dist/m365/spo/commands/term/term-get.js +6 -6
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +3 -3
- package/dist/m365/spo/commands/web/web-set.js +5 -5
- package/dist/m365/teams/commands/app/app-list.js +5 -5
- package/dist/m365/teams/commands/channel/channel-add.js +5 -1
- package/dist/m365/teams/commands/channel/channel-member-add.js +4 -2
- package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -1
- package/dist/m365/teams/commands/channel/channel-member-set.js +4 -1
- package/dist/m365/teams/commands/chat/chat-get.js +7 -10
- package/dist/m365/teams/commands/chat/chat-member-add.js +5 -5
- package/dist/m365/teams/commands/chat/chat-message-send.js +8 -10
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +4 -4
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +4 -4
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +4 -4
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +5 -5
- package/dist/m365/teams/commands/team/team-clone.js +5 -10
- package/dist/m365/teams/commands/team/team-list.js +94 -30
- package/dist/m365/teams/commands/team/team-set.js +3 -3
- package/dist/m365/tenant/commands/info/info-get.js +83 -0
- package/dist/m365/tenant/commands.js +1 -0
- package/dist/m365/todo/commands/task/task-add.js +6 -6
- package/dist/m365/yammer/commands/message/message-list.js +5 -5
- package/dist/m365/yammer/commands/yammer-search.js +5 -5
- package/dist/utils/aadGroup.js +23 -3
- package/dist/utils/formatting.js +7 -0
- package/dist/utils/fsUtil.js +5 -0
- package/dist/utils/powerPlatform.js +1 -1
- package/dist/utils/spo.js +582 -0
- package/docs/docs/cmd/aad/group/group-get.mdx +5 -5
- package/docs/docs/cmd/aad/group/group-list.mdx +0 -11
- package/docs/docs/cmd/aad/policy/policy-list.mdx +5 -5
- package/docs/docs/cmd/cli/config/config-list.mdx +1 -1
- package/docs/docs/cmd/pa/app/app-export.mdx +5 -5
- package/docs/docs/cmd/planner/task/task-add.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-get.mdx +13 -4
- package/docs/docs/cmd/planner/task/task-list.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-remove.mdx +25 -8
- package/docs/docs/cmd/planner/task/task-set.mdx +22 -7
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +94 -0
- package/docs/docs/cmd/spo/listitem/listitem-add.mdx +2 -5
- package/docs/docs/cmd/spo/listitem/listitem-set.mdx +2 -5
- package/docs/docs/cmd/spo/page/page-get.mdx +0 -1
- package/docs/docs/cmd/spo/page/page-list.mdx +0 -1
- package/docs/docs/cmd/spo/page/page-section-add.mdx +25 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +2 -4
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +2 -4
- package/docs/docs/cmd/teams/team/team-clone.mdx +3 -3
- package/docs/docs/cmd/teams/team/team-list.mdx +47 -22
- package/docs/docs/cmd/tenant/info/info-get.mdx +101 -0
- package/npm-shrinkwrap.json +196 -193
- package/package.json +8 -12
|
@@ -11,6 +11,7 @@ import { planner } from '../../../../utils/planner.js';
|
|
|
11
11
|
import { validation } from '../../../../utils/validation.js';
|
|
12
12
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
13
13
|
import commands from '../../commands.js';
|
|
14
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
14
15
|
class PlannerTaskGetCommand extends GraphCommand {
|
|
15
16
|
get name() {
|
|
16
17
|
return commands.TASK_GET;
|
|
@@ -78,7 +79,9 @@ class PlannerTaskGetCommand extends GraphCommand {
|
|
|
78
79
|
throw `The specified task ${options.title} does not exist`;
|
|
79
80
|
}
|
|
80
81
|
if (tasks.length > 1) {
|
|
81
|
-
|
|
82
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', tasks);
|
|
83
|
+
const result = (await Cli.handleMultipleResultsFound(`Multiple tasks with title '${options.title}' found.`, resultAsKeyValuePair));
|
|
84
|
+
return result.id;
|
|
82
85
|
}
|
|
83
86
|
return tasks[0].id;
|
|
84
87
|
}
|
|
@@ -101,7 +104,9 @@ class PlannerTaskGetCommand extends GraphCommand {
|
|
|
101
104
|
throw `The specified bucket ${options.bucketName} does not exist`;
|
|
102
105
|
}
|
|
103
106
|
if (buckets.length > 1) {
|
|
104
|
-
|
|
107
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', buckets);
|
|
108
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple buckets with name '${options.bucketName}' found.`, resultAsKeyValuePair);
|
|
109
|
+
return result.id;
|
|
105
110
|
}
|
|
106
111
|
return buckets[0].id;
|
|
107
112
|
}
|
|
@@ -109,9 +114,15 @@ class PlannerTaskGetCommand extends GraphCommand {
|
|
|
109
114
|
if (options.planId) {
|
|
110
115
|
return options.planId;
|
|
111
116
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
117
|
+
if (options.rosterId) {
|
|
118
|
+
const plan = await planner.getPlanByRosterId(options.rosterId);
|
|
119
|
+
return plan.id;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
const groupId = await this.getGroupId(options);
|
|
123
|
+
const plan = await planner.getPlanByTitle(options.planTitle, groupId);
|
|
124
|
+
return plan.id;
|
|
125
|
+
}
|
|
115
126
|
}
|
|
116
127
|
async getGroupId(options) {
|
|
117
128
|
if (options.ownerGroupId) {
|
|
@@ -129,46 +140,50 @@ _PlannerTaskGetCommand_instances = new WeakSet(), _PlannerTaskGetCommand_initTel
|
|
|
129
140
|
bucketId: typeof args.options.bucketId !== 'undefined',
|
|
130
141
|
bucketName: typeof args.options.bucketName !== 'undefined',
|
|
131
142
|
planId: typeof args.options.planId !== 'undefined',
|
|
143
|
+
planTitle: typeof args.options.planTitle !== 'undefined',
|
|
144
|
+
rosterId: typeof args.options.rosterId !== 'undefined',
|
|
132
145
|
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
133
146
|
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined'
|
|
134
147
|
});
|
|
135
148
|
});
|
|
136
149
|
}, _PlannerTaskGetCommand_initOptions = function _PlannerTaskGetCommand_initOptions() {
|
|
137
|
-
this.options.unshift({ option: '-i, --id [id]' }, { option: '-t, --title [title]' }, { option: '--bucketId [bucketId]' }, { option: '--bucketName [bucketName]' }, { option: '--planId [planId]' }, { option: '--planTitle [planTitle]' }, { option: '--ownerGroupId [ownerGroupId]' }, { option: '--ownerGroupName [ownerGroupName]' });
|
|
150
|
+
this.options.unshift({ option: '-i, --id [id]' }, { option: '-t, --title [title]' }, { option: '--bucketId [bucketId]' }, { option: '--bucketName [bucketName]' }, { option: '--planId [planId]' }, { option: '--planTitle [planTitle]' }, { option: '--rosterId [rosterId]' }, { option: '--ownerGroupId [ownerGroupId]' }, { option: '--ownerGroupName [ownerGroupName]' });
|
|
138
151
|
}, _PlannerTaskGetCommand_initValidators = function _PlannerTaskGetCommand_initValidators() {
|
|
139
152
|
this.validators.push(async (args) => {
|
|
140
153
|
if (args.options.id) {
|
|
141
154
|
if (args.options.bucketId || args.options.bucketName ||
|
|
142
|
-
args.options.planId || args.options.
|
|
155
|
+
args.options.planId || args.options.planTitle || args.options.rosterId ||
|
|
143
156
|
args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
144
|
-
return 'Don\'t specify bucketId, bucketName, planId, planTitle, ownerGroupId or ownerGroupName when using id';
|
|
157
|
+
return 'Don\'t specify bucketId, bucketName, planId, planTitle, rosterId, ownerGroupId or ownerGroupName when using id';
|
|
145
158
|
}
|
|
146
159
|
}
|
|
147
|
-
if (args.options.title && !args.options.bucketId && !args.options.bucketName) {
|
|
148
|
-
return 'Specify either bucketId or bucketName when using title';
|
|
149
|
-
}
|
|
150
|
-
if (args.options.title && args.options.bucketId && args.options.bucketName) {
|
|
151
|
-
return 'Specify either bucketId or bucketName when using title but not both';
|
|
152
|
-
}
|
|
153
|
-
if (args.options.bucketName && !args.options.planId && !args.options.planTitle) {
|
|
154
|
-
return 'Specify either planId or planTitle when using bucketName';
|
|
155
|
-
}
|
|
156
|
-
if (args.options.bucketName && args.options.planId && args.options.planTitle) {
|
|
157
|
-
return 'Specify either planId or planTitle when using bucketName but not both';
|
|
158
|
-
}
|
|
159
|
-
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
160
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
161
|
-
}
|
|
162
|
-
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
163
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
164
|
-
}
|
|
165
160
|
if (args.options.ownerGroupId && !validation.isValidGuid(args.options.ownerGroupId)) {
|
|
166
161
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
167
162
|
}
|
|
168
163
|
return true;
|
|
169
164
|
});
|
|
170
165
|
}, _PlannerTaskGetCommand_initOptionSets = function _PlannerTaskGetCommand_initOptionSets() {
|
|
171
|
-
this.optionSets.push({ options: ['id', 'title'] }
|
|
166
|
+
this.optionSets.push({ options: ['id', 'title'] }, {
|
|
167
|
+
options: ['planId', 'planTitle', 'rosterId'],
|
|
168
|
+
runsWhen: (args) => {
|
|
169
|
+
return args.options.id === undefined;
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
options: ['bucketId', 'bucketName'],
|
|
173
|
+
runsWhen: (args) => {
|
|
174
|
+
return args.options.title !== undefined;
|
|
175
|
+
}
|
|
176
|
+
}, {
|
|
177
|
+
options: ['planId', 'planTitle'],
|
|
178
|
+
runsWhen: (args) => {
|
|
179
|
+
return args.options.bucketName !== undefined && args.options.rosterId === undefined;
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
options: ['ownerGroupId', 'ownerGroupName'],
|
|
183
|
+
runsWhen: (args) => {
|
|
184
|
+
return args.options.planTitle !== undefined;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
172
187
|
};
|
|
173
188
|
export default new PlannerTaskGetCommand();
|
|
174
189
|
//# sourceMappingURL=task-get.js.map
|
|
@@ -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 _PlannerTaskListCommand_instances, _PlannerTaskListCommand_initTelemetry, _PlannerTaskListCommand_initOptions, _PlannerTaskListCommand_initValidators;
|
|
6
|
+
var _PlannerTaskListCommand_instances, _PlannerTaskListCommand_initTelemetry, _PlannerTaskListCommand_initOptions, _PlannerTaskListCommand_initValidators, _PlannerTaskListCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -28,6 +28,7 @@ class PlannerTaskListCommand extends GraphCommand {
|
|
|
28
28
|
__classPrivateFieldGet(this, _PlannerTaskListCommand_instances, "m", _PlannerTaskListCommand_initTelemetry).call(this);
|
|
29
29
|
__classPrivateFieldGet(this, _PlannerTaskListCommand_instances, "m", _PlannerTaskListCommand_initOptions).call(this);
|
|
30
30
|
__classPrivateFieldGet(this, _PlannerTaskListCommand_instances, "m", _PlannerTaskListCommand_initValidators).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _PlannerTaskListCommand_instances, "m", _PlannerTaskListCommand_initOptionSets).call(this);
|
|
31
32
|
}
|
|
32
33
|
async commandAction(logger, args) {
|
|
33
34
|
const bucketName = args.options.bucketName;
|
|
@@ -91,9 +92,15 @@ class PlannerTaskListCommand extends GraphCommand {
|
|
|
91
92
|
if (args.options.planId) {
|
|
92
93
|
return formatting.encodeQueryParameter(args.options.planId);
|
|
93
94
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
if (args.options.rosterId) {
|
|
96
|
+
const plan = await planner.getPlanByRosterId(args.options.rosterId);
|
|
97
|
+
return plan.id;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const groupId = await this.getGroupId(args);
|
|
101
|
+
const plan = await planner.getPlanByTitle(args.options.planTitle, groupId);
|
|
102
|
+
return plan.id;
|
|
103
|
+
}
|
|
97
104
|
}
|
|
98
105
|
async getGroupId(args) {
|
|
99
106
|
if (args.options.ownerGroupId) {
|
|
@@ -121,6 +128,7 @@ _PlannerTaskListCommand_instances = new WeakSet(), _PlannerTaskListCommand_initT
|
|
|
121
128
|
bucketName: typeof args.options.bucketName !== 'undefined',
|
|
122
129
|
planId: typeof args.options.planId !== 'undefined',
|
|
123
130
|
planTitle: typeof args.options.planTitle !== 'undefined',
|
|
131
|
+
rosterId: typeof args.options.rosterId !== 'undefined',
|
|
124
132
|
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
125
133
|
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined'
|
|
126
134
|
});
|
|
@@ -134,6 +142,8 @@ _PlannerTaskListCommand_instances = new WeakSet(), _PlannerTaskListCommand_initT
|
|
|
134
142
|
option: '--planId [planId]'
|
|
135
143
|
}, {
|
|
136
144
|
option: '--planTitle [planTitle]'
|
|
145
|
+
}, {
|
|
146
|
+
option: '--rosterId [rosterId]'
|
|
137
147
|
}, {
|
|
138
148
|
option: '--ownerGroupId [ownerGroupId]'
|
|
139
149
|
}, {
|
|
@@ -141,26 +151,23 @@ _PlannerTaskListCommand_instances = new WeakSet(), _PlannerTaskListCommand_initT
|
|
|
141
151
|
});
|
|
142
152
|
}, _PlannerTaskListCommand_initValidators = function _PlannerTaskListCommand_initValidators() {
|
|
143
153
|
this.validators.push(async (args) => {
|
|
144
|
-
if (args.options.bucketId && args.options.bucketName) {
|
|
145
|
-
return 'To retrieve tasks from a bucket, specify bucketId or bucketName, but not both';
|
|
146
|
-
}
|
|
147
|
-
if (args.options.bucketName && !args.options.planId && !args.options.planTitle) {
|
|
148
|
-
return 'Specify either planId or planTitle when using bucketName';
|
|
149
|
-
}
|
|
150
|
-
if (args.options.planId && args.options.planTitle) {
|
|
151
|
-
return 'Specify either planId or planTitle but not both';
|
|
152
|
-
}
|
|
153
|
-
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
154
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
155
|
-
}
|
|
156
|
-
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
157
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
158
|
-
}
|
|
159
154
|
if (args.options.ownerGroupId && !validation.isValidGuid(args.options.ownerGroupId)) {
|
|
160
155
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
161
156
|
}
|
|
162
157
|
return true;
|
|
163
158
|
});
|
|
159
|
+
}, _PlannerTaskListCommand_initOptionSets = function _PlannerTaskListCommand_initOptionSets() {
|
|
160
|
+
this.optionSets.push({ options: ['bucketId', 'bucketName'] }, {
|
|
161
|
+
options: ['planId', 'planTitle'],
|
|
162
|
+
runsWhen: (args) => {
|
|
163
|
+
return args.options.bucketName !== undefined && args.options.rosterId === undefined;
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
options: ['ownerGroupId', 'ownerGroupName'],
|
|
167
|
+
runsWhen: (args) => {
|
|
168
|
+
return args.options.planTitle !== undefined;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
164
171
|
};
|
|
165
172
|
export default new PlannerTaskListCommand();
|
|
166
173
|
//# sourceMappingURL=task-list.js.map
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _PlannerTaskRemoveCommand_instances, _PlannerTaskRemoveCommand_initTelemetry, _PlannerTaskRemoveCommand_initOptions, _PlannerTaskRemoveCommand_initValidators, _PlannerTaskRemoveCommand_initOptionSets;
|
|
7
|
-
import os from 'os';
|
|
8
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
9
8
|
import request from '../../../../request.js';
|
|
10
9
|
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
@@ -13,6 +12,7 @@ import { planner } from '../../../../utils/planner.js';
|
|
|
13
12
|
import { validation } from '../../../../utils/validation.js';
|
|
14
13
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
15
14
|
import commands from '../../commands.js';
|
|
15
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
16
16
|
class PlannerTaskRemoveCommand extends GraphCommand {
|
|
17
17
|
get name() {
|
|
18
18
|
return commands.TASK_REMOVE;
|
|
@@ -81,7 +81,8 @@ class PlannerTaskRemoveCommand extends GraphCommand {
|
|
|
81
81
|
throw `The specified task ${title} does not exist`;
|
|
82
82
|
}
|
|
83
83
|
if (filteredtasks.length > 1) {
|
|
84
|
-
|
|
84
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', filteredtasks);
|
|
85
|
+
return await Cli.handleMultipleResultsFound(`Multiple tasks with title '${title}' found.`, resultAsKeyValuePair);
|
|
85
86
|
}
|
|
86
87
|
return filteredtasks[0];
|
|
87
88
|
}
|
|
@@ -104,18 +105,26 @@ class PlannerTaskRemoveCommand extends GraphCommand {
|
|
|
104
105
|
throw `The specified bucket ${bucketName} does not exist`;
|
|
105
106
|
}
|
|
106
107
|
if (filteredBuckets.length > 1) {
|
|
107
|
-
|
|
108
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', filteredBuckets);
|
|
109
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple buckets with name '${bucketName}' found.`, resultAsKeyValuePair);
|
|
110
|
+
return result.id;
|
|
108
111
|
}
|
|
109
112
|
return filteredBuckets[0].id;
|
|
110
113
|
}
|
|
111
114
|
async getPlanId(options) {
|
|
112
|
-
const { planId, planTitle } = options;
|
|
115
|
+
const { planId, planTitle, rosterId } = options;
|
|
113
116
|
if (planId) {
|
|
114
117
|
return planId;
|
|
115
118
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
if (options.rosterId) {
|
|
120
|
+
const plan = await planner.getPlanByRosterId(rosterId);
|
|
121
|
+
return plan.id;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const groupId = await this.getGroupId(options);
|
|
125
|
+
const plan = await planner.getPlanByTitle(planTitle, groupId);
|
|
126
|
+
return plan.id;
|
|
127
|
+
}
|
|
119
128
|
}
|
|
120
129
|
async getGroupId(options) {
|
|
121
130
|
const { ownerGroupId, ownerGroupName } = options;
|
|
@@ -135,51 +144,50 @@ _PlannerTaskRemoveCommand_instances = new WeakSet(), _PlannerTaskRemoveCommand_i
|
|
|
135
144
|
bucketName: typeof args.options.bucketName !== 'undefined',
|
|
136
145
|
planId: typeof args.options.planId !== 'undefined',
|
|
137
146
|
planTitle: typeof args.options.planTitle !== 'undefined',
|
|
147
|
+
rosterId: typeof args.options.rosterId !== 'undefined',
|
|
138
148
|
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
139
149
|
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined',
|
|
140
150
|
force: !!args.options.force
|
|
141
151
|
});
|
|
142
152
|
});
|
|
143
153
|
}, _PlannerTaskRemoveCommand_initOptions = function _PlannerTaskRemoveCommand_initOptions() {
|
|
144
|
-
this.options.unshift({ option: '-i, --id [id]' }, { option: '-t, --title [title]' }, { option: '--bucketId [bucketId]' }, { option: '--bucketName [bucketName]' }, { option: '--planId [planId]' }, { option: '--planTitle [planTitle]' }, { option: '--ownerGroupId [ownerGroupId]' }, { option: '--ownerGroupName [ownerGroupName]' }, { option: '-f, --force' });
|
|
154
|
+
this.options.unshift({ option: '-i, --id [id]' }, { option: '-t, --title [title]' }, { option: '--bucketId [bucketId]' }, { option: '--bucketName [bucketName]' }, { option: '--planId [planId]' }, { option: '--planTitle [planTitle]' }, { option: '--rosterId [rosterId]' }, { option: '--ownerGroupId [ownerGroupId]' }, { option: '--ownerGroupName [ownerGroupName]' }, { option: '-f, --force' });
|
|
145
155
|
}, _PlannerTaskRemoveCommand_initValidators = function _PlannerTaskRemoveCommand_initValidators() {
|
|
146
156
|
this.validators.push(async (args) => {
|
|
147
157
|
if (args.options.id) {
|
|
148
|
-
if (args.options.bucketId || args.options.bucketName ||
|
|
149
|
-
|
|
158
|
+
if (args.options.bucketId || args.options.bucketName ||
|
|
159
|
+
args.options.planId || args.options.planTitle || args.options.rosterId ||
|
|
160
|
+
args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
161
|
+
return 'Don\'t specify bucketId,bucketName, planId, planTitle, rosterId, ownerGroupId, or ownerGroupName when using id';
|
|
150
162
|
}
|
|
151
163
|
}
|
|
152
|
-
if (args.options.
|
|
153
|
-
|
|
154
|
-
return 'Specify either bucketId or bucketName when using title';
|
|
155
|
-
}
|
|
156
|
-
if (args.options.bucketId && args.options.bucketName) {
|
|
157
|
-
return 'Specify either bucketId or bucketName when using title but not both';
|
|
158
|
-
}
|
|
159
|
-
if (args.options.bucketName) {
|
|
160
|
-
if (!args.options.planId && !args.options.planTitle) {
|
|
161
|
-
return 'Specify either planId or planTitle when using bucketName';
|
|
162
|
-
}
|
|
163
|
-
if (args.options.planId && args.options.planTitle) {
|
|
164
|
-
return 'Specify either planId or planTitle when using bucketName but not both';
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
if (args.options.planTitle) {
|
|
168
|
-
if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
169
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
170
|
-
}
|
|
171
|
-
if (args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
172
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
if (args.options.ownerGroupId && !validation.isValidGuid(args.options.ownerGroupId)) {
|
|
176
|
-
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
177
|
-
}
|
|
164
|
+
if (args.options.ownerGroupId && !validation.isValidGuid(args.options.ownerGroupId)) {
|
|
165
|
+
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
178
166
|
}
|
|
179
167
|
return true;
|
|
180
168
|
});
|
|
181
169
|
}, _PlannerTaskRemoveCommand_initOptionSets = function _PlannerTaskRemoveCommand_initOptionSets() {
|
|
182
|
-
this.optionSets.push({ options: ['id', 'title'] }
|
|
170
|
+
this.optionSets.push({ options: ['id', 'title'] }, {
|
|
171
|
+
options: ['planId', 'planTitle', 'rosterId'],
|
|
172
|
+
runsWhen: (args) => {
|
|
173
|
+
return args.options.id === undefined;
|
|
174
|
+
}
|
|
175
|
+
}, {
|
|
176
|
+
options: ['bucketId', 'bucketName'],
|
|
177
|
+
runsWhen: (args) => {
|
|
178
|
+
return args.options.title !== undefined;
|
|
179
|
+
}
|
|
180
|
+
}, {
|
|
181
|
+
options: ['planId', 'planTitle'],
|
|
182
|
+
runsWhen: (args) => {
|
|
183
|
+
return args.options.bucketName !== undefined && args.options.rosterId === undefined;
|
|
184
|
+
}
|
|
185
|
+
}, {
|
|
186
|
+
options: ['ownerGroupId', 'ownerGroupName'],
|
|
187
|
+
runsWhen: (args) => {
|
|
188
|
+
return args.options.planTitle !== undefined;
|
|
189
|
+
}
|
|
190
|
+
});
|
|
183
191
|
};
|
|
184
192
|
export default new PlannerTaskRemoveCommand();
|
|
185
193
|
//# sourceMappingURL=task-remove.js.map
|
|
@@ -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 _PlannerTaskSetCommand_instances, _PlannerTaskSetCommand_initTelemetry, _PlannerTaskSetCommand_initOptions, _PlannerTaskSetCommand_initValidators;
|
|
6
|
+
var _PlannerTaskSetCommand_instances, _PlannerTaskSetCommand_initTelemetry, _PlannerTaskSetCommand_initOptions, _PlannerTaskSetCommand_initValidators, _PlannerTaskSetCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -26,6 +26,7 @@ class PlannerTaskSetCommand extends GraphCommand {
|
|
|
26
26
|
__classPrivateFieldGet(this, _PlannerTaskSetCommand_instances, "m", _PlannerTaskSetCommand_initTelemetry).call(this);
|
|
27
27
|
__classPrivateFieldGet(this, _PlannerTaskSetCommand_instances, "m", _PlannerTaskSetCommand_initOptions).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _PlannerTaskSetCommand_instances, "m", _PlannerTaskSetCommand_initValidators).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _PlannerTaskSetCommand_instances, "m", _PlannerTaskSetCommand_initOptionSets).call(this);
|
|
29
30
|
}
|
|
30
31
|
async commandAction(logger, args) {
|
|
31
32
|
try {
|
|
@@ -170,9 +171,15 @@ class PlannerTaskSetCommand extends GraphCommand {
|
|
|
170
171
|
if (options.planId) {
|
|
171
172
|
return options.planId;
|
|
172
173
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
if (options.rosterId) {
|
|
175
|
+
const plan = await planner.getPlanByRosterId(options.rosterId);
|
|
176
|
+
return plan.id;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
const groupId = await this.getGroupId(options);
|
|
180
|
+
const plan = await planner.getPlanByTitle(options.planTitle, groupId);
|
|
181
|
+
return plan.id;
|
|
182
|
+
}
|
|
176
183
|
}
|
|
177
184
|
async getGroupId(options) {
|
|
178
185
|
if (options.ownerGroupId) {
|
|
@@ -222,6 +229,7 @@ _PlannerTaskSetCommand_instances = new WeakSet(), _PlannerTaskSetCommand_initTel
|
|
|
222
229
|
title: typeof args.options.title !== 'undefined',
|
|
223
230
|
planId: typeof args.options.planId !== 'undefined',
|
|
224
231
|
planTitle: typeof args.options.planTitle !== 'undefined',
|
|
232
|
+
rosterId: typeof args.options.rosterId !== 'undefined',
|
|
225
233
|
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
226
234
|
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined',
|
|
227
235
|
bucketId: typeof args.options.bucketId !== 'undefined',
|
|
@@ -239,24 +247,9 @@ _PlannerTaskSetCommand_instances = new WeakSet(), _PlannerTaskSetCommand_initTel
|
|
|
239
247
|
});
|
|
240
248
|
});
|
|
241
249
|
}, _PlannerTaskSetCommand_initOptions = function _PlannerTaskSetCommand_initOptions() {
|
|
242
|
-
this.options.unshift({ option: '-i, --id <id>' }, { option: '-t, --title [title]' }, { option: '--planId [planId]' }, { option: '--planTitle [planTitle]' }, { option: '--ownerGroupId [ownerGroupId]' }, { option: '--ownerGroupName [ownerGroupName]' }, { option: '--bucketId [bucketId]' }, { option: '--bucketName [bucketName]' }, { option: '--startDateTime [startDateTime]' }, { option: '--dueDateTime [dueDateTime]' }, { option: '--percentComplete [percentComplete]' }, { option: '--assignedToUserIds [assignedToUserIds]' }, { option: '--assignedToUserNames [assignedToUserNames]' }, { option: '--assigneePriority [assigneePriority]' }, { option: '--description [description]' }, { option: '--appliedCategories [appliedCategories]' }, { option: '--orderHint [orderHint]' }, { option: '--priority [priority]', autocomplete: taskPriority.priorityValues });
|
|
250
|
+
this.options.unshift({ option: '-i, --id <id>' }, { option: '-t, --title [title]' }, { option: '--planId [planId]' }, { option: '--planTitle [planTitle]' }, { option: '--rosterId [rosterId]' }, { option: '--ownerGroupId [ownerGroupId]' }, { option: '--ownerGroupName [ownerGroupName]' }, { option: '--bucketId [bucketId]' }, { option: '--bucketName [bucketName]' }, { option: '--startDateTime [startDateTime]' }, { option: '--dueDateTime [dueDateTime]' }, { option: '--percentComplete [percentComplete]' }, { option: '--assignedToUserIds [assignedToUserIds]' }, { option: '--assignedToUserNames [assignedToUserNames]' }, { option: '--assigneePriority [assigneePriority]' }, { option: '--description [description]' }, { option: '--appliedCategories [appliedCategories]' }, { option: '--orderHint [orderHint]' }, { option: '--priority [priority]', autocomplete: taskPriority.priorityValues });
|
|
243
251
|
}, _PlannerTaskSetCommand_initValidators = function _PlannerTaskSetCommand_initValidators() {
|
|
244
252
|
this.validators.push(async (args) => {
|
|
245
|
-
if (args.options.bucketId && args.options.bucketName) {
|
|
246
|
-
return 'Specify either bucketId or bucketName but not both';
|
|
247
|
-
}
|
|
248
|
-
if (args.options.bucketName && !args.options.planId && !args.options.planTitle) {
|
|
249
|
-
return 'Specify either planId or planTitle when using bucketName';
|
|
250
|
-
}
|
|
251
|
-
if (args.options.bucketName && args.options.planId && args.options.planTitle) {
|
|
252
|
-
return 'Specify either planId or planTitle when using bucketName but not both';
|
|
253
|
-
}
|
|
254
|
-
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
255
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
256
|
-
}
|
|
257
|
-
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
258
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
259
|
-
}
|
|
260
253
|
if (args.options.ownerGroupId && !validation.isValidGuid(args.options.ownerGroupId)) {
|
|
261
254
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
262
255
|
}
|
|
@@ -275,9 +268,6 @@ _PlannerTaskSetCommand_instances = new WeakSet(), _PlannerTaskSetCommand_initTel
|
|
|
275
268
|
if (args.options.assignedToUserIds && !validation.isValidGuidArray(args.options.assignedToUserIds.split(','))) {
|
|
276
269
|
return 'assignedToUserIds contains invalid GUID';
|
|
277
270
|
}
|
|
278
|
-
if (args.options.assignedToUserIds && args.options.assignedToUserNames) {
|
|
279
|
-
return 'Specify either assignedToUserIds or assignedToUserNames but not both';
|
|
280
|
-
}
|
|
281
271
|
if (args.options.appliedCategories && args.options.appliedCategories.split(',').filter(category => this.allowedAppliedCategories.indexOf(category.toLocaleLowerCase()) < 0).length !== 0) {
|
|
282
272
|
return 'The appliedCategories contains invalid value. Specify either category1, category2, category3, category4, category5 and/or category6 as properties';
|
|
283
273
|
}
|
|
@@ -293,6 +283,28 @@ _PlannerTaskSetCommand_instances = new WeakSet(), _PlannerTaskSetCommand_initTel
|
|
|
293
283
|
}
|
|
294
284
|
return true;
|
|
295
285
|
});
|
|
286
|
+
}, _PlannerTaskSetCommand_initOptionSets = function _PlannerTaskSetCommand_initOptionSets() {
|
|
287
|
+
this.optionSets.push({
|
|
288
|
+
options: ['bucketId', 'bucketName'],
|
|
289
|
+
runsWhen: (args) => {
|
|
290
|
+
return args.options.bucketId || args.options.bucketName;
|
|
291
|
+
}
|
|
292
|
+
}, {
|
|
293
|
+
options: ['planId', 'planTitle', 'rosterId'],
|
|
294
|
+
runsWhen: (args) => {
|
|
295
|
+
return args.options.bucketName !== undefined;
|
|
296
|
+
}
|
|
297
|
+
}, {
|
|
298
|
+
options: ['ownerGroupId', 'ownerGroupName'],
|
|
299
|
+
runsWhen: (args) => {
|
|
300
|
+
return args.options.planTitle !== undefined;
|
|
301
|
+
}
|
|
302
|
+
}, {
|
|
303
|
+
options: ['assignedToUserIds', 'assignedToUserNames'],
|
|
304
|
+
runsWhen: (args) => {
|
|
305
|
+
return args.options.assignedToUserIds || args.options.assignedToUserNames;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
296
308
|
};
|
|
297
309
|
export default new PlannerTaskSetCommand();
|
|
298
310
|
//# sourceMappingURL=task-set.js.map
|
|
@@ -4,7 +4,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _PpAiBuilderModelGetCommand_instances, _PpAiBuilderModelGetCommand_initTelemetry, _PpAiBuilderModelGetCommand_initOptions, _PpAiBuilderModelGetCommand_initOptionSets, _PpAiBuilderModelGetCommand_initValidators;
|
|
7
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
7
8
|
import request from '../../../../request.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
8
10
|
import { powerPlatform } from '../../../../utils/powerPlatform.js';
|
|
9
11
|
import { validation } from '../../../../utils/validation.js';
|
|
10
12
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
@@ -58,7 +60,8 @@ class PpAiBuilderModelGetCommand extends PowerPlatformCommand {
|
|
|
58
60
|
throw `The specified AI builder model '${options.name}' does not exist.`;
|
|
59
61
|
}
|
|
60
62
|
if (result.value.length > 1) {
|
|
61
|
-
|
|
63
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('msdyn_aimodelid', result.value);
|
|
64
|
+
return await Cli.handleMultipleResultsFound(`Multiple AI builder models with name '${options.name}' found.`, resultAsKeyValuePair);
|
|
62
65
|
}
|
|
63
66
|
return result.value[0];
|
|
64
67
|
}
|
|
@@ -10,6 +10,7 @@ import { powerPlatform } from '../../../../utils/powerPlatform.js';
|
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
13
14
|
class PpCardGetCommand extends PowerPlatformCommand {
|
|
14
15
|
get name() {
|
|
15
16
|
return commands.CARD_GET;
|
|
@@ -59,11 +60,8 @@ class PpCardGetCommand extends PowerPlatformCommand {
|
|
|
59
60
|
throw `The specified card '${options.name}' does not exist.`;
|
|
60
61
|
}
|
|
61
62
|
if (result.value.length > 1) {
|
|
62
|
-
const resultAsKeyValuePair =
|
|
63
|
-
|
|
64
|
-
resultAsKeyValuePair[obj.cardid] = obj;
|
|
65
|
-
});
|
|
66
|
-
return Cli.handleMultipleResultsFound(`Multiple cards with name '${options.name}' found. Choose the correct ID:`, `Multiple cards with name '${options.name}' found.`, resultAsKeyValuePair);
|
|
63
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('cardid', result.value);
|
|
64
|
+
return Cli.handleMultipleResultsFound(`Multiple cards with name '${options.name}' found`, resultAsKeyValuePair);
|
|
67
65
|
}
|
|
68
66
|
return result.value[0];
|
|
69
67
|
}
|
|
@@ -10,6 +10,7 @@ import { powerPlatform } from '../../../../utils/powerPlatform.js';
|
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
13
14
|
class PpChatbotGetCommand extends PowerPlatformCommand {
|
|
14
15
|
get name() {
|
|
15
16
|
return commands.CHATBOT_GET;
|
|
@@ -56,7 +57,8 @@ class PpChatbotGetCommand extends PowerPlatformCommand {
|
|
|
56
57
|
requestOptions.url = `${dynamicsApiUrl}/api/data/v9.1/bots?$filter=name eq '${formatting.encodeQueryParameter(options.name)}'`;
|
|
57
58
|
const result = await request.get(requestOptions);
|
|
58
59
|
if (result.value.length > 1) {
|
|
59
|
-
|
|
60
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('botid', result.value);
|
|
61
|
+
return await Cli.handleMultipleResultsFound(`Multiple chatbots with name '${options.name}' found.`, resultAsKeyValuePair);
|
|
60
62
|
}
|
|
61
63
|
if (result.value.length === 0) {
|
|
62
64
|
throw `The specified chatbot '${options.name}' does not exist.`;
|
|
@@ -9,6 +9,7 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
10
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
12
13
|
class PpManagementAppAddCommand extends PowerPlatformCommand {
|
|
13
14
|
get name() {
|
|
14
15
|
return commands.MANAGEMENTAPP_ADD;
|
|
@@ -65,7 +66,9 @@ class PpManagementAppAddCommand extends PowerPlatformCommand {
|
|
|
65
66
|
if (aadApps.value.length === 1 && aadApps.value[0].appId) {
|
|
66
67
|
return aadApps.value[0].appId;
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('appId', aadApps.value);
|
|
70
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple Azure AD application registration with name '${name}' found.`, resultAsKeyValuePair);
|
|
71
|
+
return result.appId;
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
_PpManagementAppAddCommand_instances = new WeakSet(), _PpManagementAppAddCommand_initTelemetry = function _PpManagementAppAddCommand_initTelemetry() {
|
|
@@ -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 _PurviewRetentionLabelAddCommand_instances, _PurviewRetentionLabelAddCommand_initTelemetry, _PurviewRetentionLabelAddCommand_initOptions, _PurviewRetentionLabelAddCommand_initValidators, _PurviewRetentionLabelAddCommand_initOptionSets;
|
|
6
|
+
var _PurviewRetentionLabelAddCommand_instances, _a, _PurviewRetentionLabelAddCommand_initTelemetry, _PurviewRetentionLabelAddCommand_initOptions, _PurviewRetentionLabelAddCommand_initValidators, _PurviewRetentionLabelAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
@@ -90,7 +90,7 @@ class PurviewRetentionLabelAddCommand extends GraphCommand {
|
|
|
90
90
|
return filteredEventTypes[0].id;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
_PurviewRetentionLabelAddCommand_instances = new WeakSet(), _PurviewRetentionLabelAddCommand_initTelemetry = function _PurviewRetentionLabelAddCommand_initTelemetry() {
|
|
93
|
+
_a = PurviewRetentionLabelAddCommand, _PurviewRetentionLabelAddCommand_instances = new WeakSet(), _PurviewRetentionLabelAddCommand_initTelemetry = function _PurviewRetentionLabelAddCommand_initTelemetry() {
|
|
94
94
|
this.telemetry.push((args) => {
|
|
95
95
|
Object.assign(this.telemetryProperties, {
|
|
96
96
|
retentionTrigger: typeof args.options.retentionTrigger !== 'undefined',
|
|
@@ -107,18 +107,18 @@ _PurviewRetentionLabelAddCommand_instances = new WeakSet(), _PurviewRetentionLab
|
|
|
107
107
|
option: '-n, --displayName <displayName>'
|
|
108
108
|
}, {
|
|
109
109
|
option: '--behaviorDuringRetentionPeriod <behaviorDuringRetentionPeriod>',
|
|
110
|
-
autocomplete:
|
|
110
|
+
autocomplete: _a.behaviorDuringRetentionPeriods
|
|
111
111
|
}, {
|
|
112
112
|
option: '--actionAfterRetentionPeriod <actionAfterRetentionPeriod>',
|
|
113
|
-
autocomplete:
|
|
113
|
+
autocomplete: _a.actionAfterRetentionPeriods
|
|
114
114
|
}, {
|
|
115
115
|
option: '--retentionDuration <retentionDuration>'
|
|
116
116
|
}, {
|
|
117
117
|
option: '-t, --retentionTrigger [retentionTrigger]',
|
|
118
|
-
autocomplete:
|
|
118
|
+
autocomplete: _a.retentionTriggers
|
|
119
119
|
}, {
|
|
120
120
|
option: '--defaultRecordBehavior [defaultRecordBehavior]',
|
|
121
|
-
autocomplete:
|
|
121
|
+
autocomplete: _a.defaultRecordBehavior
|
|
122
122
|
}, {
|
|
123
123
|
option: '--descriptionForUsers [descriptionForUsers]'
|
|
124
124
|
}, {
|
|
@@ -135,19 +135,19 @@ _PurviewRetentionLabelAddCommand_instances = new WeakSet(), _PurviewRetentionLab
|
|
|
135
135
|
if (isNaN(args.options.retentionDuration)) {
|
|
136
136
|
return `Specified retentionDuration ${args.options.retentionDuration} is not a number`;
|
|
137
137
|
}
|
|
138
|
-
if (
|
|
139
|
-
return `${args.options.behaviorDuringRetentionPeriod} is not a valid behavior of a document with the label. Allowed values are ${
|
|
138
|
+
if (_a.behaviorDuringRetentionPeriods.indexOf(args.options.behaviorDuringRetentionPeriod) === -1) {
|
|
139
|
+
return `${args.options.behaviorDuringRetentionPeriod} is not a valid behavior of a document with the label. Allowed values are ${_a.behaviorDuringRetentionPeriods.join(', ')}`;
|
|
140
140
|
}
|
|
141
|
-
if (
|
|
142
|
-
return `${args.options.actionAfterRetentionPeriod} is not a valid action to take on a document with the label. Allowed values are ${
|
|
141
|
+
if (_a.actionAfterRetentionPeriods.indexOf(args.options.actionAfterRetentionPeriod) === -1) {
|
|
142
|
+
return `${args.options.actionAfterRetentionPeriod} is not a valid action to take on a document with the label. Allowed values are ${_a.actionAfterRetentionPeriods.join(', ')}`;
|
|
143
143
|
}
|
|
144
144
|
if (args.options.retentionTrigger &&
|
|
145
|
-
|
|
146
|
-
return `${args.options.retentionTrigger} is not a valid action retention duration calculation. Allowed values are ${
|
|
145
|
+
_a.retentionTriggers.indexOf(args.options.retentionTrigger) === -1) {
|
|
146
|
+
return `${args.options.retentionTrigger} is not a valid action retention duration calculation. Allowed values are ${_a.retentionTriggers.join(', ')}`;
|
|
147
147
|
}
|
|
148
148
|
if (args.options.defaultRecordBehavior &&
|
|
149
|
-
|
|
150
|
-
return `${args.options.defaultRecordBehavior} is not a valid state of a record label. Allowed values are ${
|
|
149
|
+
_a.defaultRecordBehavior.indexOf(args.options.defaultRecordBehavior) === -1) {
|
|
150
|
+
return `${args.options.defaultRecordBehavior} is not a valid state of a record label. Allowed values are ${_a.defaultRecordBehavior.join(', ')}`;
|
|
151
151
|
}
|
|
152
152
|
return true;
|
|
153
153
|
});
|
|
@@ -41,7 +41,9 @@ class SearchExternalConnectionRemoveCommand extends GraphCommand {
|
|
|
41
41
|
if (res.value.length === 0) {
|
|
42
42
|
throw `The specified connection does not exist in Microsoft Search`;
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
45
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple external connections with name ${args.options.name} found.`, resultAsKeyValuePair);
|
|
46
|
+
return result.id;
|
|
45
47
|
}
|
|
46
48
|
async commandAction(logger, args) {
|
|
47
49
|
if (args.options.force) {
|