@pnp/cli-microsoft365 11.9.0 → 11.10.0-beta.3e566b1
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 +50 -0
- package/Dockerfile +1 -1
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +4 -2
- package/dist/m365/outlook/commands/event/event-get.js +77 -0
- package/dist/m365/outlook/commands.js +1 -0
- package/dist/m365/planner/commands/roster/roster-add.js +5 -0
- package/dist/m365/planner/commands/roster/roster-get.js +8 -18
- package/dist/m365/planner/commands/roster/roster-member-add.js +29 -45
- package/dist/m365/planner/commands/roster/roster-member-get.js +28 -44
- package/dist/m365/planner/commands/roster/roster-member-list.js +8 -18
- package/dist/m365/planner/commands/roster/roster-member-remove.js +30 -48
- package/dist/m365/planner/commands/roster/roster-plan-list.js +28 -46
- package/dist/m365/planner/commands/roster/roster-remove.js +9 -27
- package/dist/m365/planner/commands/task/task-add.js +97 -111
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +10 -23
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +16 -26
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +10 -23
- package/dist/m365/planner/commands/task/task-get.js +46 -69
- package/dist/m365/planner/commands/task/task-list.js +33 -69
- package/dist/m365/planner/commands/task/task-reference-add.js +15 -35
- package/dist/m365/planner/commands/task/task-reference-list.js +8 -18
- package/dist/m365/planner/commands/task/task-reference-remove.js +26 -36
- package/dist/m365/planner/commands/task/task-remove.js +47 -71
- package/dist/m365/planner/commands/task/task-set.js +92 -113
- package/dist/m365/pp/commands/website/Webrole.js +2 -0
- package/dist/m365/pp/commands/website/website-remove.js +80 -0
- package/dist/m365/pp/commands/website/website-webrole-list.js +61 -0
- package/dist/m365/pp/commands.js +3 -1
- package/dist/m365/purview/commands/auditlog/auditlog-list.js +36 -60
- package/dist/m365/purview/commands/retentionevent/retentionevent-add.js +34 -53
- package/dist/m365/purview/commands/retentionevent/retentionevent-get.js +10 -23
- package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +11 -32
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-add.js +9 -24
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-get.js +10 -23
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +11 -32
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-set.js +21 -35
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +40 -82
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-get.js +10 -23
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-remove.js +11 -32
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-set.js +35 -78
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-get.js +19 -44
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-list.js +16 -39
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-policysettings-list.js +16 -39
- package/dist/m365/purview/commands/threatassessment/threatassessment-add.js +44 -67
- package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +11 -33
- package/dist/m365/purview/commands/threatassessment/threatassessment-list.js +10 -33
- package/dist/m365/spo/commands/homesite/homesite-remove.js +1 -1
- package/dist/m365/spo/commands/web/{web-alert-list.js → web-rule-list.js} +7 -4
- package/dist/m365/spo/commands/web/{web-alert-remove.js → web-rule-remove.js} +7 -4
- package/dist/m365/spo/commands.js +2 -0
- package/dist/utils/powerPlatform.js +20 -0
- package/docs/docs/cmd/outlook/event/event-get.mdx +280 -0
- package/docs/docs/cmd/pp/website/website-remove.mdx +89 -0
- package/docs/docs/cmd/pp/website/website-webrole-list.mdx +139 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.mdx +21 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +19 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.mdx +19 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.mdx +21 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +21 -0
- package/docs/docs/cmd/spo/cdn/cdn-get.mdx +19 -0
- package/docs/docs/cmd/spo/cdn/cdn-origin-add.mdx +21 -0
- package/docs/docs/cmd/spo/cdn/cdn-origin-list.mdx +19 -0
- package/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx +21 -0
- package/docs/docs/cmd/spo/cdn/cdn-policy-list.mdx +19 -0
- package/docs/docs/cmd/spo/cdn/cdn-policy-set.mdx +21 -0
- package/docs/docs/cmd/spo/cdn/cdn-set.mdx +21 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-add.mdx +19 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-get.mdx +19 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-list.mdx +19 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-remove.mdx +21 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-set.mdx +21 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-sync.mdx +19 -0
- package/docs/docs/cmd/spo/field/field-add.mdx +19 -0
- package/docs/docs/cmd/spo/field/field-get.mdx +19 -0
- package/docs/docs/cmd/spo/field/field-list.mdx +19 -0
- package/docs/docs/cmd/spo/field/field-remove.mdx +21 -0
- package/docs/docs/cmd/spo/field/field-set.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +19 -0
- package/docs/docs/cmd/spo/homesite/homesite-add.mdx +21 -2
- package/docs/docs/cmd/spo/homesite/homesite-get.mdx +19 -0
- package/docs/docs/cmd/spo/homesite/homesite-list.mdx +19 -0
- package/docs/docs/cmd/spo/homesite/homesite-remove.mdx +24 -3
- package/docs/docs/cmd/spo/homesite/homesite-set.mdx +21 -2
- package/docs/docs/cmd/spo/hubsite/hubsite-connect.mdx +21 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-data-get.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-disconnect.mdx +21 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-get.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-list.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-register.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-rights-grant.mdx +21 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.mdx +21 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-set.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-unregister.mdx +21 -0
- package/docs/docs/cmd/spo/web/{web-alert-list.mdx → web-rule-list.mdx} +13 -7
- package/docs/docs/cmd/spo/web/{web-alert-remove.mdx → web-rule-remove.mdx} +10 -4
- package/npm-shrinkwrap.json +1363 -650
- package/package.json +16 -16
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _PlannerRosterRemoveCommand_instances, _PlannerRosterRemoveCommand_initTelemetry, _PlannerRosterRemoveCommand_initOptions, _PlannerRosterRemoveCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { cli } from '../../../../cli/cli.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
id: z.string(),
|
|
10
|
+
force: z.boolean().optional().alias('f')
|
|
11
|
+
});
|
|
11
12
|
class PlannerRosterRemoveCommand extends GraphCommand {
|
|
12
13
|
get name() {
|
|
13
14
|
return commands.ROSTER_REMOVE;
|
|
@@ -15,12 +16,8 @@ class PlannerRosterRemoveCommand extends GraphCommand {
|
|
|
15
16
|
get description() {
|
|
16
17
|
return 'Removes a Microsoft Planner Roster';
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_PlannerRosterRemoveCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _PlannerRosterRemoveCommand_instances, "m", _PlannerRosterRemoveCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _PlannerRosterRemoveCommand_instances, "m", _PlannerRosterRemoveCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _PlannerRosterRemoveCommand_instances, "m", _PlannerRosterRemoveCommand_initTypes).call(this);
|
|
19
|
+
get schema() {
|
|
20
|
+
return options;
|
|
24
21
|
}
|
|
25
22
|
async commandAction(logger, args) {
|
|
26
23
|
if (args.options.force) {
|
|
@@ -52,20 +49,5 @@ class PlannerRosterRemoveCommand extends GraphCommand {
|
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
|
-
_PlannerRosterRemoveCommand_instances = new WeakSet(), _PlannerRosterRemoveCommand_initTelemetry = function _PlannerRosterRemoveCommand_initTelemetry() {
|
|
56
|
-
this.telemetry.push((args) => {
|
|
57
|
-
Object.assign(this.telemetryProperties, {
|
|
58
|
-
force: !!args.options.force
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
}, _PlannerRosterRemoveCommand_initOptions = function _PlannerRosterRemoveCommand_initOptions() {
|
|
62
|
-
this.options.unshift({
|
|
63
|
-
option: '--id <id>'
|
|
64
|
-
}, {
|
|
65
|
-
option: '-f, --force'
|
|
66
|
-
});
|
|
67
|
-
}, _PlannerRosterRemoveCommand_initTypes = function _PlannerRosterRemoveCommand_initTypes() {
|
|
68
|
-
this.types.string.push('id');
|
|
69
|
-
};
|
|
70
52
|
export default new PlannerRosterRemoveCommand();
|
|
71
53
|
//# sourceMappingURL=roster-remove.js.map
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _PlannerTaskAddCommand_instances, _PlannerTaskAddCommand_initTelemetry, _PlannerTaskAddCommand_initOptions, _PlannerTaskAddCommand_initValidators, _PlannerTaskAddCommand_initOptionSets, _PlannerTaskAddCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -12,6 +8,78 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
12
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
14
10
|
import { taskPriority } from '../../taskPriority.js';
|
|
11
|
+
const allowedAppliedCategories = ['category1', 'category2', 'category3', 'category4', 'category5', 'category6'];
|
|
12
|
+
const allowedPreviewTypes = ['automatic', 'nopreview', 'checklist', 'description', 'reference'];
|
|
13
|
+
export const options = z.strictObject({
|
|
14
|
+
...globalOptionsZod.shape,
|
|
15
|
+
title: z.string().alias('t'),
|
|
16
|
+
planId: z.string().optional(),
|
|
17
|
+
planTitle: z.string().optional(),
|
|
18
|
+
rosterId: z.string().optional(),
|
|
19
|
+
ownerGroupId: z.string()
|
|
20
|
+
.refine(val => validation.isValidGuid(val), {
|
|
21
|
+
message: 'The value is not a valid GUID.'
|
|
22
|
+
})
|
|
23
|
+
.optional(),
|
|
24
|
+
ownerGroupName: z.string().optional(),
|
|
25
|
+
bucketId: z.string().optional(),
|
|
26
|
+
bucketName: z.string().optional(),
|
|
27
|
+
startDateTime: z.string()
|
|
28
|
+
.refine(val => validation.isValidISODateTime(val), {
|
|
29
|
+
message: 'The startDateTime is not a valid ISO date string.'
|
|
30
|
+
})
|
|
31
|
+
.optional(),
|
|
32
|
+
dueDateTime: z.string()
|
|
33
|
+
.refine(val => validation.isValidISODateTime(val), {
|
|
34
|
+
message: 'The dueDateTime is not a valid ISO date string.'
|
|
35
|
+
})
|
|
36
|
+
.optional(),
|
|
37
|
+
percentComplete: z.string()
|
|
38
|
+
.refine(val => !isNaN(Number(val)) && Number(val) >= 0 && Number(val) <= 100, {
|
|
39
|
+
message: 'percentComplete should be between 0 and 100.'
|
|
40
|
+
})
|
|
41
|
+
.optional(),
|
|
42
|
+
assignedToUserIds: z.string()
|
|
43
|
+
.superRefine((val, ctx) => {
|
|
44
|
+
const result = validation.isValidGuidArray(val);
|
|
45
|
+
if (result !== true) {
|
|
46
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: `The following GUIDs are invalid for the option 'assignedToUserIds': ${result}.` });
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
.optional(),
|
|
50
|
+
assignedToUserNames: z.string()
|
|
51
|
+
.superRefine((val, ctx) => {
|
|
52
|
+
const result = validation.isValidUserPrincipalNameArray(val);
|
|
53
|
+
if (result !== true) {
|
|
54
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: `The following user principal names are invalid for the option 'assignedToUserNames': ${result}.` });
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
.optional(),
|
|
58
|
+
assigneePriority: z.string().optional(),
|
|
59
|
+
description: z.string().optional(),
|
|
60
|
+
appliedCategories: z.string()
|
|
61
|
+
.refine(val => val.split(',').every(cat => allowedAppliedCategories.includes(cat.toLocaleLowerCase().trim())), {
|
|
62
|
+
message: `The appliedCategories contains invalid value. Specify either ${allowedAppliedCategories.join(', ')} as properties.`
|
|
63
|
+
})
|
|
64
|
+
.optional(),
|
|
65
|
+
previewType: z.string()
|
|
66
|
+
.refine(val => allowedPreviewTypes.includes(val.toLocaleLowerCase()), {
|
|
67
|
+
message: `The value is not a valid preview type. Allowed values are ${allowedPreviewTypes.join(', ')}.`
|
|
68
|
+
})
|
|
69
|
+
.optional(),
|
|
70
|
+
orderHint: z.string().optional(),
|
|
71
|
+
priority: z.string()
|
|
72
|
+
.refine(val => {
|
|
73
|
+
const num = Number(val);
|
|
74
|
+
if (!isNaN(num)) {
|
|
75
|
+
return num >= 0 && num <= 10 && Number.isInteger(num);
|
|
76
|
+
}
|
|
77
|
+
return taskPriority.priorityValues.map(l => l.toLowerCase()).includes(val.toLowerCase());
|
|
78
|
+
}, {
|
|
79
|
+
message: `The value is not a valid priority. Allowed values are 0-10 or ${taskPriority.priorityValues.join('|')}.`
|
|
80
|
+
})
|
|
81
|
+
.optional()
|
|
82
|
+
});
|
|
15
83
|
class PlannerTaskAddCommand extends GraphCommand {
|
|
16
84
|
get name() {
|
|
17
85
|
return commands.TASK_ADD;
|
|
@@ -19,16 +87,27 @@ class PlannerTaskAddCommand extends GraphCommand {
|
|
|
19
87
|
get description() {
|
|
20
88
|
return 'Adds a new Microsoft Planner Task';
|
|
21
89
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
90
|
+
get schema() {
|
|
91
|
+
return options;
|
|
92
|
+
}
|
|
93
|
+
getRefinedSchema(schema) {
|
|
94
|
+
return schema
|
|
95
|
+
.refine(opts => [opts.planId, opts.planTitle, opts.rosterId].filter(x => x !== undefined).length === 1, {
|
|
96
|
+
message: `Specify exactly one of the following options: 'planId', 'planTitle' or 'rosterId'.`,
|
|
97
|
+
params: { customCode: 'optionSet', options: ['planId', 'planTitle', 'rosterId'] }
|
|
98
|
+
})
|
|
99
|
+
.refine(opts => [opts.bucketId, opts.bucketName].filter(x => x !== undefined).length === 1, {
|
|
100
|
+
message: `Specify exactly one of the following options: 'bucketId' or 'bucketName'.`,
|
|
101
|
+
params: { customCode: 'optionSet', options: ['bucketId', 'bucketName'] }
|
|
102
|
+
})
|
|
103
|
+
.refine(opts => !opts.planTitle || [opts.ownerGroupId, opts.ownerGroupName].filter(x => x !== undefined).length === 1, {
|
|
104
|
+
message: `Specify exactly one of the following options: 'ownerGroupId' or 'ownerGroupName'.`,
|
|
105
|
+
params: { customCode: 'optionSet', options: ['ownerGroupId', 'ownerGroupName'] }
|
|
106
|
+
})
|
|
107
|
+
.refine(opts => !(opts.assignedToUserIds && opts.assignedToUserNames), {
|
|
108
|
+
message: 'Specify either assignedToUserIds or assignedToUserNames but not both.',
|
|
109
|
+
params: { customCode: 'optionSet', options: ['assignedToUserIds', 'assignedToUserNames'] }
|
|
110
|
+
});
|
|
32
111
|
}
|
|
33
112
|
async commandAction(logger, args) {
|
|
34
113
|
try {
|
|
@@ -48,7 +127,7 @@ class PlannerTaskAddCommand extends GraphCommand {
|
|
|
48
127
|
title: args.options.title,
|
|
49
128
|
startDateTime: args.options.startDateTime,
|
|
50
129
|
dueDateTime: args.options.dueDateTime,
|
|
51
|
-
percentComplete: args.options.percentComplete,
|
|
130
|
+
percentComplete: args.options.percentComplete ? Number(args.options.percentComplete) : undefined,
|
|
52
131
|
assignments: assignments,
|
|
53
132
|
orderHint: args.options.orderHint,
|
|
54
133
|
assigneePriority: args.options.assigneePriority,
|
|
@@ -83,7 +162,7 @@ class PlannerTaskAddCommand extends GraphCommand {
|
|
|
83
162
|
return {};
|
|
84
163
|
}
|
|
85
164
|
const categories = {};
|
|
86
|
-
options.appliedCategories.toLocaleLowerCase().split(',').forEach(x => categories[x] = true);
|
|
165
|
+
options.appliedCategories.toLocaleLowerCase().split(',').forEach(x => categories[x.trim()] = true);
|
|
87
166
|
return categories;
|
|
88
167
|
}
|
|
89
168
|
async updateTaskDetails(options, newTask) {
|
|
@@ -148,7 +227,6 @@ class PlannerTaskAddCommand extends GraphCommand {
|
|
|
148
227
|
if (options.assignedToUserIds) {
|
|
149
228
|
return options.assignedToUserIds.split(',');
|
|
150
229
|
}
|
|
151
|
-
// Hitting this section means assignedToUserNames won't be undefined
|
|
152
230
|
const userNames = options.assignedToUserNames;
|
|
153
231
|
const userArr = userNames.split(',').map(o => o.trim());
|
|
154
232
|
const promises = userArr.map(user => {
|
|
@@ -165,7 +243,6 @@ class PlannerTaskAddCommand extends GraphCommand {
|
|
|
165
243
|
let userUpns = [];
|
|
166
244
|
userUpns = usersRes.map(res => res.value[0]?.userPrincipalName);
|
|
167
245
|
const userIds = usersRes.map(res => res.value[0]?.id);
|
|
168
|
-
// Find the members where no graph response was found
|
|
169
246
|
const invalidUsers = userArr.filter(user => !userUpns.some((upn) => upn?.toLowerCase() === user.toLowerCase()));
|
|
170
247
|
if (invalidUsers && invalidUsers.length > 0) {
|
|
171
248
|
throw `Cannot proceed with planner task creation. The following users provided are invalid : ${invalidUsers.join(',')}`;
|
|
@@ -173,96 +250,5 @@ class PlannerTaskAddCommand extends GraphCommand {
|
|
|
173
250
|
return userIds;
|
|
174
251
|
}
|
|
175
252
|
}
|
|
176
|
-
_PlannerTaskAddCommand_instances = new WeakSet(), _PlannerTaskAddCommand_initTelemetry = function _PlannerTaskAddCommand_initTelemetry() {
|
|
177
|
-
this.telemetry.push((args) => {
|
|
178
|
-
Object.assign(this.telemetryProperties, {
|
|
179
|
-
planId: typeof args.options.planId !== 'undefined',
|
|
180
|
-
planTitle: typeof args.options.planTitle !== 'undefined',
|
|
181
|
-
rosterId: typeof args.options.rosterId !== 'undefined',
|
|
182
|
-
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
183
|
-
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined',
|
|
184
|
-
bucketId: typeof args.options.bucketId !== 'undefined',
|
|
185
|
-
bucketName: typeof args.options.bucketName !== 'undefined',
|
|
186
|
-
startDateTime: typeof args.options.startDateTime !== 'undefined',
|
|
187
|
-
dueDateTime: typeof args.options.dueDateTime !== 'undefined',
|
|
188
|
-
percentComplete: typeof args.options.percentComplete !== 'undefined',
|
|
189
|
-
assignedToUserIds: typeof args.options.assignedToUserIds !== 'undefined',
|
|
190
|
-
assignedToUserNames: typeof args.options.assignedToUserNames !== 'undefined',
|
|
191
|
-
assigneePriority: typeof args.options.assigneePriority !== 'undefined',
|
|
192
|
-
description: typeof args.options.description !== 'undefined',
|
|
193
|
-
appliedCategories: typeof args.options.appliedCategories !== 'undefined',
|
|
194
|
-
previewType: typeof args.options.previewType !== 'undefined',
|
|
195
|
-
orderHint: typeof args.options.orderHint !== 'undefined',
|
|
196
|
-
priority: typeof args.options.priority !== 'undefined'
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
}, _PlannerTaskAddCommand_initOptions = function _PlannerTaskAddCommand_initOptions() {
|
|
200
|
-
this.options.unshift({ 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]' }, {
|
|
201
|
-
option: '--appliedCategories [appliedCategories]',
|
|
202
|
-
autocomplete: this.allowedAppliedCategories
|
|
203
|
-
}, {
|
|
204
|
-
option: '--previewType [previewType]',
|
|
205
|
-
autocomplete: this.allowedPreviewTypes
|
|
206
|
-
}, { option: '--orderHint [orderHint]' }, { option: '--priority [priority]', autocomplete: taskPriority.priorityValues });
|
|
207
|
-
}, _PlannerTaskAddCommand_initValidators = function _PlannerTaskAddCommand_initValidators() {
|
|
208
|
-
this.validators.push(async (args) => {
|
|
209
|
-
if (args.options.ownerGroupId && !validation.isValidGuid(args.options.ownerGroupId)) {
|
|
210
|
-
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
211
|
-
}
|
|
212
|
-
if (args.options.startDateTime && !validation.isValidISODateTime(args.options.startDateTime)) {
|
|
213
|
-
return 'The startDateTime is not a valid ISO date string';
|
|
214
|
-
}
|
|
215
|
-
if (args.options.dueDateTime && !validation.isValidISODateTime(args.options.dueDateTime)) {
|
|
216
|
-
return 'The dueDateTime is not a valid ISO date string';
|
|
217
|
-
}
|
|
218
|
-
if (args.options.percentComplete && isNaN(args.options.percentComplete)) {
|
|
219
|
-
return `percentComplete is not a number`;
|
|
220
|
-
}
|
|
221
|
-
if (args.options.percentComplete && (args.options.percentComplete < 0 || args.options.percentComplete > 100)) {
|
|
222
|
-
return `percentComplete should be between 0 and 100`;
|
|
223
|
-
}
|
|
224
|
-
if (args.options.assignedToUserIds) {
|
|
225
|
-
const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.assignedToUserIds);
|
|
226
|
-
if (isValidGUIDArrayResult !== true) {
|
|
227
|
-
return `The following GUIDs are invalid for the option 'assignedToUserIds': ${isValidGUIDArrayResult}.`;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
if (args.options.assignedToUserIds && args.options.assignedToUserNames) {
|
|
231
|
-
return 'Specify either assignedToUserIds or assignedToUserNames but not both';
|
|
232
|
-
}
|
|
233
|
-
if (args.options.assignedToUserNames) {
|
|
234
|
-
const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.assignedToUserNames);
|
|
235
|
-
if (isValidUPNArrayResult !== true) {
|
|
236
|
-
return `The following user principal names are invalid for the option 'assignedToUserNames': ${isValidUPNArrayResult}.`;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
if (args.options.appliedCategories && args.options.appliedCategories.split(',').filter(category => this.allowedAppliedCategories.indexOf(category.toLocaleLowerCase()) < 0).length !== 0) {
|
|
240
|
-
return `The appliedCategories contains invalid value. Specify either ${this.allowedAppliedCategories.join(', ')} as properties`;
|
|
241
|
-
}
|
|
242
|
-
if (args.options.previewType && this.allowedPreviewTypes.indexOf(args.options.previewType.toLocaleLowerCase()) === -1) {
|
|
243
|
-
return `${args.options.previewType} is not a valid preview type value. Allowed values are ${this.allowedPreviewTypes.join(', ')}`;
|
|
244
|
-
}
|
|
245
|
-
if (args.options.priority !== undefined) {
|
|
246
|
-
if (typeof args.options.priority === "number") {
|
|
247
|
-
if (isNaN(args.options.priority) || args.options.priority < 0 || args.options.priority > 10 || !Number.isInteger(args.options.priority)) {
|
|
248
|
-
return 'priority should be an integer between 0 and 10.';
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
else if (taskPriority.priorityValues.map(l => l.toLowerCase()).indexOf(args.options.priority.toString().toLowerCase()) === -1) {
|
|
252
|
-
return `${args.options.priority} is not a valid priority value. Allowed values are ${taskPriority.priorityValues.join('|')}.`;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
return true;
|
|
256
|
-
});
|
|
257
|
-
}, _PlannerTaskAddCommand_initOptionSets = function _PlannerTaskAddCommand_initOptionSets() {
|
|
258
|
-
this.optionSets.push({ options: ['planId', 'planTitle', 'rosterId'] }, { options: ['bucketId', 'bucketName'] }, {
|
|
259
|
-
options: ['ownerGroupId', 'ownerGroupName'],
|
|
260
|
-
runsWhen: (args) => {
|
|
261
|
-
return args.options.planTitle !== undefined;
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
}, _PlannerTaskAddCommand_initTypes = function _PlannerTaskAddCommand_initTypes() {
|
|
265
|
-
this.types.string.push('title', 'planId', 'planTitle', 'rosterId', 'ownerGroupId', 'ownerGroupName', 'bucketId', 'bucketName', 'startDateTime', 'dueDateTime', 'assignedToUserIds', 'assignedToUserNames', 'appliedCategories', 'previewType', 'description', 'assigneePriority', 'orderHint');
|
|
266
|
-
};
|
|
267
253
|
export default new PlannerTaskAddCommand();
|
|
268
254
|
//# sourceMappingURL=task-add.js.map
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _PlannerTaskChecklistItemAddCommand_instances, _PlannerTaskChecklistItemAddCommand_initTelemetry, _PlannerTaskChecklistItemAddCommand_initOptions, _PlannerTaskChecklistItemAddCommand_initTypes;
|
|
7
1
|
import { v4 } from 'uuid';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import { cli } from '../../../../cli/cli.js';
|
|
9
5
|
import request from '../../../../request.js';
|
|
10
6
|
import { formatting } from '../../../../utils/formatting.js';
|
|
11
7
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
8
|
import commands from '../../commands.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
taskId: z.string().alias('i'),
|
|
12
|
+
title: z.string().alias('t'),
|
|
13
|
+
isChecked: z.boolean().optional()
|
|
14
|
+
});
|
|
13
15
|
class PlannerTaskChecklistItemAddCommand extends GraphCommand {
|
|
14
16
|
get name() {
|
|
15
17
|
return commands.TASK_CHECKLISTITEM_ADD;
|
|
@@ -17,12 +19,8 @@ class PlannerTaskChecklistItemAddCommand extends GraphCommand {
|
|
|
17
19
|
get description() {
|
|
18
20
|
return 'Adds a new checklist item to a Planner task.';
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_PlannerTaskChecklistItemAddCommand_instances.add(this);
|
|
23
|
-
__classPrivateFieldGet(this, _PlannerTaskChecklistItemAddCommand_instances, "m", _PlannerTaskChecklistItemAddCommand_initTelemetry).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _PlannerTaskChecklistItemAddCommand_instances, "m", _PlannerTaskChecklistItemAddCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _PlannerTaskChecklistItemAddCommand_instances, "m", _PlannerTaskChecklistItemAddCommand_initTypes).call(this);
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
26
24
|
}
|
|
27
25
|
async commandAction(logger, args) {
|
|
28
26
|
try {
|
|
@@ -73,16 +71,5 @@ class PlannerTaskChecklistItemAddCommand extends GraphCommand {
|
|
|
73
71
|
return task['@odata.etag'];
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
|
-
_PlannerTaskChecklistItemAddCommand_instances = new WeakSet(), _PlannerTaskChecklistItemAddCommand_initTelemetry = function _PlannerTaskChecklistItemAddCommand_initTelemetry() {
|
|
77
|
-
this.telemetry.push((args) => {
|
|
78
|
-
Object.assign(this.telemetryProperties, {
|
|
79
|
-
isChecked: !!args.options.isChecked
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}, _PlannerTaskChecklistItemAddCommand_initOptions = function _PlannerTaskChecklistItemAddCommand_initOptions() {
|
|
83
|
-
this.options.unshift({ option: '-i, --taskId <taskId>' }, { option: '-t, --title <title>' }, { option: '--isChecked' });
|
|
84
|
-
}, _PlannerTaskChecklistItemAddCommand_initTypes = function _PlannerTaskChecklistItemAddCommand_initTypes() {
|
|
85
|
-
this.types.string.push('title', 'taskId');
|
|
86
|
-
};
|
|
87
74
|
export default new PlannerTaskChecklistItemAddCommand();
|
|
88
75
|
//# sourceMappingURL=task-checklistitem-add.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import { cli } from '../../../../cli/cli.js';
|
|
4
|
+
import request from '../../../../request.js';
|
|
5
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
6
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
7
|
+
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
taskId: z.string().alias('i')
|
|
11
|
+
});
|
|
12
12
|
class PlannerTaskChecklistItemListCommand extends GraphCommand {
|
|
13
13
|
get name() {
|
|
14
14
|
return commands.TASK_CHECKLISTITEM_LIST;
|
|
@@ -16,22 +16,19 @@ class PlannerTaskChecklistItemListCommand extends GraphCommand {
|
|
|
16
16
|
get description() {
|
|
17
17
|
return 'Lists the checklist items of a Planner task.';
|
|
18
18
|
}
|
|
19
|
+
get schema() {
|
|
20
|
+
return options;
|
|
21
|
+
}
|
|
19
22
|
defaultProperties() {
|
|
20
23
|
return ['id', 'title', 'isChecked'];
|
|
21
24
|
}
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
_PlannerTaskChecklistItemListCommand_instances.add(this);
|
|
25
|
-
__classPrivateFieldGet(this, _PlannerTaskChecklistItemListCommand_instances, "m", _PlannerTaskChecklistItemListCommand_initOptions).call(this);
|
|
26
|
-
__classPrivateFieldGet(this, _PlannerTaskChecklistItemListCommand_instances, "m", _PlannerTaskChecklistItemListCommand_initTypes).call(this);
|
|
27
|
-
}
|
|
28
25
|
async commandAction(logger, args) {
|
|
29
26
|
const requestOptions = {
|
|
30
27
|
url: `${this.resource}/v1.0/planner/tasks/${formatting.encodeQueryParameter(args.options.taskId)}/details?$select=checklist`,
|
|
31
28
|
headers: {
|
|
32
|
-
accept:
|
|
29
|
+
accept: 'application/json;odata.metadata=none'
|
|
33
30
|
},
|
|
34
|
-
responseType:
|
|
31
|
+
responseType: 'json'
|
|
35
32
|
};
|
|
36
33
|
try {
|
|
37
34
|
const res = await request.get(requestOptions);
|
|
@@ -49,12 +46,5 @@ class PlannerTaskChecklistItemListCommand extends GraphCommand {
|
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
|
-
_PlannerTaskChecklistItemListCommand_instances = new WeakSet(), _PlannerTaskChecklistItemListCommand_initOptions = function _PlannerTaskChecklistItemListCommand_initOptions() {
|
|
53
|
-
this.options.unshift({
|
|
54
|
-
option: "-i, --taskId <taskId>"
|
|
55
|
-
});
|
|
56
|
-
}, _PlannerTaskChecklistItemListCommand_initTypes = function _PlannerTaskChecklistItemListCommand_initTypes() {
|
|
57
|
-
this.types.string.push('taskId');
|
|
58
|
-
};
|
|
59
49
|
export default new PlannerTaskChecklistItemListCommand();
|
|
60
50
|
//# sourceMappingURL=task-checklistitem-list.js.map
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _PlannerTaskChecklistItemRemoveCommand_instances, _PlannerTaskChecklistItemRemoveCommand_initTelemetry, _PlannerTaskChecklistItemRemoveCommand_initOptions, _PlannerTaskChecklistItemRemoveCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { cli } from '../../../../cli/cli.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
6
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
id: z.string().alias('i'),
|
|
11
|
+
taskId: z.string(),
|
|
12
|
+
force: z.boolean().optional().alias('f')
|
|
13
|
+
});
|
|
12
14
|
class PlannerTaskChecklistItemRemoveCommand extends GraphCommand {
|
|
13
15
|
get name() {
|
|
14
16
|
return commands.TASK_CHECKLISTITEM_REMOVE;
|
|
@@ -16,12 +18,8 @@ class PlannerTaskChecklistItemRemoveCommand extends GraphCommand {
|
|
|
16
18
|
get description() {
|
|
17
19
|
return 'Removes the checklist item from the planner task';
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_PlannerTaskChecklistItemRemoveCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _PlannerTaskChecklistItemRemoveCommand_instances, "m", _PlannerTaskChecklistItemRemoveCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _PlannerTaskChecklistItemRemoveCommand_instances, "m", _PlannerTaskChecklistItemRemoveCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _PlannerTaskChecklistItemRemoveCommand_instances, "m", _PlannerTaskChecklistItemRemoveCommand_initTypes).call(this);
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
25
23
|
}
|
|
26
24
|
async commandAction(logger, args) {
|
|
27
25
|
if (args.options.force) {
|
|
@@ -71,16 +69,5 @@ class PlannerTaskChecklistItemRemoveCommand extends GraphCommand {
|
|
|
71
69
|
return await request.get(requestOptions);
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
_PlannerTaskChecklistItemRemoveCommand_instances = new WeakSet(), _PlannerTaskChecklistItemRemoveCommand_initTelemetry = function _PlannerTaskChecklistItemRemoveCommand_initTelemetry() {
|
|
75
|
-
this.telemetry.push((args) => {
|
|
76
|
-
Object.assign(this.telemetryProperties, {
|
|
77
|
-
force: !!args.options.force
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
}, _PlannerTaskChecklistItemRemoveCommand_initOptions = function _PlannerTaskChecklistItemRemoveCommand_initOptions() {
|
|
81
|
-
this.options.unshift({ option: '-i, --id <id>' }, { option: '--taskId <taskId>' }, { option: '-f, --force' });
|
|
82
|
-
}, _PlannerTaskChecklistItemRemoveCommand_initTypes = function _PlannerTaskChecklistItemRemoveCommand_initTypes() {
|
|
83
|
-
this.types.string.push('id', 'taskId');
|
|
84
|
-
};
|
|
85
72
|
export default new PlannerTaskChecklistItemRemoveCommand();
|
|
86
73
|
//# sourceMappingURL=task-checklistitem-remove.js.map
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _PlannerTaskGetCommand_instances, _PlannerTaskGetCommand_initTelemetry, _PlannerTaskGetCommand_initOptions, _PlannerTaskGetCommand_initValidators, _PlannerTaskGetCommand_initOptionSets, _PlannerTaskGetCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -12,6 +8,22 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
12
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
14
10
|
import { cli } from '../../../../cli/cli.js';
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
id: z.string().optional().alias('i'),
|
|
14
|
+
title: z.string().optional().alias('t'),
|
|
15
|
+
bucketId: z.string().optional(),
|
|
16
|
+
bucketName: z.string().optional(),
|
|
17
|
+
planId: z.string().optional(),
|
|
18
|
+
planTitle: z.string().optional(),
|
|
19
|
+
rosterId: z.string().optional(),
|
|
20
|
+
ownerGroupId: z.string()
|
|
21
|
+
.refine(val => validation.isValidGuid(val), {
|
|
22
|
+
message: 'The value is not a valid GUID.'
|
|
23
|
+
})
|
|
24
|
+
.optional(),
|
|
25
|
+
ownerGroupName: z.string().optional()
|
|
26
|
+
});
|
|
15
27
|
class PlannerTaskGetCommand extends GraphCommand {
|
|
16
28
|
get name() {
|
|
17
29
|
return commands.TASK_GET;
|
|
@@ -19,14 +31,34 @@ class PlannerTaskGetCommand extends GraphCommand {
|
|
|
19
31
|
get description() {
|
|
20
32
|
return 'Retrieves the specified planner task';
|
|
21
33
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
get schema() {
|
|
35
|
+
return options;
|
|
36
|
+
}
|
|
37
|
+
getRefinedSchema(schema) {
|
|
38
|
+
return schema
|
|
39
|
+
.refine(opts => [opts.id, opts.title].filter(x => x !== undefined).length === 1, {
|
|
40
|
+
message: `Specify exactly one of the following options: 'id' or 'title'.`,
|
|
41
|
+
params: { customCode: 'optionSet', options: ['id', 'title'] }
|
|
42
|
+
})
|
|
43
|
+
.refine(opts => opts.id !== undefined || opts.bucketId !== undefined || [opts.planId, opts.planTitle, opts.rosterId].filter(x => x !== undefined).length === 1, {
|
|
44
|
+
message: `Specify exactly one of the following options: 'planId', 'planTitle' or 'rosterId'.`,
|
|
45
|
+
params: { customCode: 'optionSet', options: ['planId', 'planTitle', 'rosterId'] }
|
|
46
|
+
})
|
|
47
|
+
.refine(opts => opts.id !== undefined || [opts.bucketId, opts.bucketName].filter(x => x !== undefined).length === 1, {
|
|
48
|
+
message: `Specify exactly one of the following options: 'bucketId' or 'bucketName'.`,
|
|
49
|
+
params: { customCode: 'optionSet', options: ['bucketId', 'bucketName'] }
|
|
50
|
+
})
|
|
51
|
+
.refine(opts => !(opts.bucketName && !opts.rosterId) || [opts.planId, opts.planTitle].filter(x => x !== undefined).length === 1, {
|
|
52
|
+
message: `Specify exactly one of the following options: 'planId' or 'planTitle'.`,
|
|
53
|
+
params: { customCode: 'optionSet', options: ['planId', 'planTitle'] }
|
|
54
|
+
})
|
|
55
|
+
.refine(opts => !opts.planTitle || [opts.ownerGroupId, opts.ownerGroupName].filter(x => x !== undefined).length === 1, {
|
|
56
|
+
message: `Specify exactly one of the following options: 'ownerGroupId' or 'ownerGroupName'.`,
|
|
57
|
+
params: { customCode: 'optionSet', options: ['ownerGroupId', 'ownerGroupName'] }
|
|
58
|
+
})
|
|
59
|
+
.refine(opts => !opts.id || !(opts.bucketId || opts.bucketName || opts.planId || opts.planTitle || opts.rosterId || opts.ownerGroupId || opts.ownerGroupName), {
|
|
60
|
+
message: `Don't specify bucketId, bucketName, planId, planTitle, rosterId, ownerGroupId or ownerGroupName when using id.`
|
|
61
|
+
});
|
|
30
62
|
}
|
|
31
63
|
async commandAction(logger, args) {
|
|
32
64
|
try {
|
|
@@ -112,60 +144,5 @@ class PlannerTaskGetCommand extends GraphCommand {
|
|
|
112
144
|
return entraGroup.getGroupIdByDisplayName(options.ownerGroupName);
|
|
113
145
|
}
|
|
114
146
|
}
|
|
115
|
-
_PlannerTaskGetCommand_instances = new WeakSet(), _PlannerTaskGetCommand_initTelemetry = function _PlannerTaskGetCommand_initTelemetry() {
|
|
116
|
-
this.telemetry.push((args) => {
|
|
117
|
-
Object.assign(this.telemetryProperties, {
|
|
118
|
-
id: typeof args.options.id !== 'undefined',
|
|
119
|
-
title: typeof args.options.title !== 'undefined',
|
|
120
|
-
bucketId: typeof args.options.bucketId !== 'undefined',
|
|
121
|
-
bucketName: typeof args.options.bucketName !== 'undefined',
|
|
122
|
-
planId: typeof args.options.planId !== 'undefined',
|
|
123
|
-
planTitle: typeof args.options.planTitle !== 'undefined',
|
|
124
|
-
rosterId: typeof args.options.rosterId !== 'undefined',
|
|
125
|
-
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
126
|
-
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined'
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
}, _PlannerTaskGetCommand_initOptions = function _PlannerTaskGetCommand_initOptions() {
|
|
130
|
-
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]' });
|
|
131
|
-
}, _PlannerTaskGetCommand_initValidators = function _PlannerTaskGetCommand_initValidators() {
|
|
132
|
-
this.validators.push(async (args) => {
|
|
133
|
-
if (args.options.id) {
|
|
134
|
-
if (args.options.bucketId || args.options.bucketName ||
|
|
135
|
-
args.options.planId || args.options.planTitle || args.options.rosterId ||
|
|
136
|
-
args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
137
|
-
return 'Don\'t specify bucketId, bucketName, planId, planTitle, rosterId, ownerGroupId or ownerGroupName when using id';
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (args.options.ownerGroupId && !validation.isValidGuid(args.options.ownerGroupId)) {
|
|
141
|
-
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
142
|
-
}
|
|
143
|
-
return true;
|
|
144
|
-
});
|
|
145
|
-
}, _PlannerTaskGetCommand_initOptionSets = function _PlannerTaskGetCommand_initOptionSets() {
|
|
146
|
-
this.optionSets.push({ options: ['id', 'title'] }, {
|
|
147
|
-
options: ['planId', 'planTitle', 'rosterId'],
|
|
148
|
-
runsWhen: (args) => {
|
|
149
|
-
return args.options.id === undefined;
|
|
150
|
-
}
|
|
151
|
-
}, {
|
|
152
|
-
options: ['bucketId', 'bucketName'],
|
|
153
|
-
runsWhen: (args) => {
|
|
154
|
-
return args.options.title !== undefined;
|
|
155
|
-
}
|
|
156
|
-
}, {
|
|
157
|
-
options: ['planId', 'planTitle'],
|
|
158
|
-
runsWhen: (args) => {
|
|
159
|
-
return args.options.bucketName !== undefined && args.options.rosterId === undefined;
|
|
160
|
-
}
|
|
161
|
-
}, {
|
|
162
|
-
options: ['ownerGroupId', 'ownerGroupName'],
|
|
163
|
-
runsWhen: (args) => {
|
|
164
|
-
return args.options.planTitle !== undefined;
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
}, _PlannerTaskGetCommand_initTypes = function _PlannerTaskGetCommand_initTypes() {
|
|
168
|
-
this.types.string.push('id', 'title', 'planId', 'planTitle', 'ownerGroupId', 'ownerGroupName', 'bucketId', 'bucketName', 'rosterId');
|
|
169
|
-
};
|
|
170
147
|
export default new PlannerTaskGetCommand();
|
|
171
148
|
//# sourceMappingURL=task-get.js.map
|