@pnp/cli-microsoft365 11.10.0-beta.6b0583b → 11.10.0-beta.df8d498
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/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.23.2.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.23.2.js +55 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
- 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/spfx/project/project-upgrade.mdx +1 -1
- 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 +1361 -648
- package/package.json +15 -15
package/dist/Auth.js
CHANGED
|
@@ -361,7 +361,7 @@ export class Auth {
|
|
|
361
361
|
if (response.message) {
|
|
362
362
|
await logger.logToStderr(`🌶️ ${response.message}`);
|
|
363
363
|
}
|
|
364
|
-
if (cli.getSettingWithDefaultValue(settingsNames.autoOpenLinksInBrowser, false)) {
|
|
364
|
+
if (cli.getSettingWithDefaultValue(settingsNames.autoOpenLinksInBrowser, false) && response.verificationUri !== undefined) {
|
|
365
365
|
await browserUtil.open(response.verificationUri);
|
|
366
366
|
}
|
|
367
367
|
if (cli.getSettingWithDefaultValue(settingsNames.copyDeviceCodeToClipboard, false)) {
|
|
@@ -372,7 +372,9 @@ export class Auth {
|
|
|
372
372
|
if (!this._clipboardy) {
|
|
373
373
|
this._clipboardy = (await import('clipboardy')).default;
|
|
374
374
|
}
|
|
375
|
-
|
|
375
|
+
if (response.userCode !== undefined) {
|
|
376
|
+
this._clipboardy.writeSync(response.userCode);
|
|
377
|
+
}
|
|
376
378
|
}
|
|
377
379
|
}
|
|
378
380
|
async ensureAccessTokenWithPassword(resource, logger, debug) {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import { validation } from '../../../../utils/validation.js';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
+
import request from '../../../../request.js';
|
|
7
|
+
import { calendar } from '../../../../utils/calendar.js';
|
|
8
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
id: z.string().alias('i'),
|
|
12
|
+
userId: z.string().refine(id => validation.isValidGuid(id), {
|
|
13
|
+
error: e => `'${e.input}' is not a valid GUID.`
|
|
14
|
+
}).optional(),
|
|
15
|
+
userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
16
|
+
error: e => `'${e.input}' is not a valid UPN.`
|
|
17
|
+
}).optional(),
|
|
18
|
+
calendarId: z.string().optional(),
|
|
19
|
+
calendarName: z.string().optional(),
|
|
20
|
+
timeZone: z.string().optional()
|
|
21
|
+
});
|
|
22
|
+
class OutlookEventGetCommand extends GraphCommand {
|
|
23
|
+
get name() {
|
|
24
|
+
return commands.EVENT_GET;
|
|
25
|
+
}
|
|
26
|
+
get description() {
|
|
27
|
+
return `Retrieve an event from a specific calendar of a user`;
|
|
28
|
+
}
|
|
29
|
+
get schema() {
|
|
30
|
+
return options;
|
|
31
|
+
}
|
|
32
|
+
getRefinedSchema(schema) {
|
|
33
|
+
return schema
|
|
34
|
+
.refine(options => [options.userId, options.userName].filter(x => x !== undefined).length === 1, {
|
|
35
|
+
error: 'Specify either userId or userName, but not both'
|
|
36
|
+
})
|
|
37
|
+
.refine(options => !(options.calendarId && options.calendarName), {
|
|
38
|
+
error: 'Specify either calendarId or calendarName, but not both.'
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async commandAction(logger, args) {
|
|
42
|
+
const userIdentifier = args.options.userId ?? args.options.userName;
|
|
43
|
+
if (this.verbose) {
|
|
44
|
+
await logger.logToStderr(`Retrieving event ${args.options.id} for user ${userIdentifier}...`);
|
|
45
|
+
}
|
|
46
|
+
let calendarId = args.options.calendarId;
|
|
47
|
+
if (args.options.calendarName) {
|
|
48
|
+
calendarId = (await calendar.getUserCalendarByName(userIdentifier, args.options.calendarName)).id;
|
|
49
|
+
}
|
|
50
|
+
let requestUrl = `${this.resource}/v1.0/users('${formatting.encodeQueryParameter(userIdentifier)}')`;
|
|
51
|
+
if (calendarId) {
|
|
52
|
+
requestUrl += `/calendars/${calendarId}/events/${args.options.id}`;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
requestUrl += `/events/${args.options.id}`;
|
|
56
|
+
}
|
|
57
|
+
const requestOptions = {
|
|
58
|
+
url: requestUrl,
|
|
59
|
+
headers: {
|
|
60
|
+
accept: 'application/json;odata.metadata=none'
|
|
61
|
+
},
|
|
62
|
+
responseType: 'json'
|
|
63
|
+
};
|
|
64
|
+
if (args.options.timeZone) {
|
|
65
|
+
requestOptions.headers.Prefer = `outlook.timezone="${args.options.timeZone}"`;
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const result = await request.get(requestOptions);
|
|
69
|
+
await logger.log(result);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
this.handleRejectedODataJsonPromise(err);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export default new OutlookEventGetCommand();
|
|
77
|
+
//# sourceMappingURL=event-get.js.map
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
CALENDARGROUP_REMOVE: `${prefix} calendargroup remove`,
|
|
11
11
|
CALENDARGROUP_SET: `${prefix} calendargroup set`,
|
|
12
12
|
EVENT_CANCEL: `${prefix} event cancel`,
|
|
13
|
+
EVENT_GET: `${prefix} event get`,
|
|
13
14
|
EVENT_LIST: `${prefix} event list`,
|
|
14
15
|
EVENT_REMOVE: `${prefix} event remove`,
|
|
15
16
|
MAIL_SEARCHFOLDER_ADD: `${prefix} mail searchfolder add`,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
1
2
|
import request from '../../../../request.js';
|
|
2
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
4
|
import commands from '../../commands.js';
|
|
5
|
+
export const options = globalOptionsZod.strict();
|
|
4
6
|
class PlannerRosterAddCommand extends GraphCommand {
|
|
5
7
|
get name() {
|
|
6
8
|
return commands.ROSTER_ADD;
|
|
@@ -8,6 +10,9 @@ class PlannerRosterAddCommand extends GraphCommand {
|
|
|
8
10
|
get description() {
|
|
9
11
|
return 'Creates a new Microsoft Planner Roster';
|
|
10
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
11
16
|
async commandAction(logger) {
|
|
12
17
|
if (this.verbose) {
|
|
13
18
|
await logger.logToStderr('Creating a new Microsoft Planner Roster');
|
|
@@ -1,12 +1,12 @@
|
|
|
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 _PlannerRosterGetCommand_instances, _PlannerRosterGetCommand_initOptions, _PlannerRosterGetCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
9
5
|
import commands from '../../commands.js';
|
|
6
|
+
export const options = z.strictObject({
|
|
7
|
+
...globalOptionsZod.shape,
|
|
8
|
+
id: z.string()
|
|
9
|
+
});
|
|
10
10
|
class PlannerRosterGetCommand extends GraphCommand {
|
|
11
11
|
get name() {
|
|
12
12
|
return commands.ROSTER_GET;
|
|
@@ -14,11 +14,8 @@ class PlannerRosterGetCommand extends GraphCommand {
|
|
|
14
14
|
get description() {
|
|
15
15
|
return 'Gets information about the specific Microsoft Planner Roster';
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
_PlannerRosterGetCommand_instances.add(this);
|
|
20
|
-
__classPrivateFieldGet(this, _PlannerRosterGetCommand_instances, "m", _PlannerRosterGetCommand_initOptions).call(this);
|
|
21
|
-
__classPrivateFieldGet(this, _PlannerRosterGetCommand_instances, "m", _PlannerRosterGetCommand_initTypes).call(this);
|
|
17
|
+
get schema() {
|
|
18
|
+
return options;
|
|
22
19
|
}
|
|
23
20
|
async commandAction(logger, args) {
|
|
24
21
|
if (this.verbose) {
|
|
@@ -40,12 +37,5 @@ class PlannerRosterGetCommand extends GraphCommand {
|
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
_PlannerRosterGetCommand_instances = new WeakSet(), _PlannerRosterGetCommand_initOptions = function _PlannerRosterGetCommand_initOptions() {
|
|
44
|
-
this.options.unshift({
|
|
45
|
-
option: '--id <id>'
|
|
46
|
-
});
|
|
47
|
-
}, _PlannerRosterGetCommand_initTypes = function _PlannerRosterGetCommand_initTypes() {
|
|
48
|
-
this.types.string.push('id');
|
|
49
|
-
};
|
|
50
40
|
export default new PlannerRosterGetCommand();
|
|
51
41
|
//# sourceMappingURL=roster-get.js.map
|
|
@@ -1,14 +1,24 @@
|
|
|
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 _PlannerRosterMemberAddCommand_instances, _PlannerRosterMemberAddCommand_initTelemetry, _PlannerRosterMemberAddCommand_initOptions, _PlannerRosterMemberAddCommand_initOptionSets, _PlannerRosterMemberAddCommand_initValidators, _PlannerRosterMemberAddCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { entraUser } from '../../../../utils/entraUser.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.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
|
+
rosterId: z.string(),
|
|
11
|
+
userId: z.string()
|
|
12
|
+
.refine(val => validation.isValidGuid(val), {
|
|
13
|
+
message: 'The value is not a valid GUID.'
|
|
14
|
+
})
|
|
15
|
+
.optional(),
|
|
16
|
+
userName: z.string()
|
|
17
|
+
.refine(val => validation.isValidUserPrincipalName(val), {
|
|
18
|
+
message: 'The value is not a valid user principal name (UPN).'
|
|
19
|
+
})
|
|
20
|
+
.optional()
|
|
21
|
+
});
|
|
12
22
|
class PlannerRosterMemberAddCommand extends GraphCommand {
|
|
13
23
|
get name() {
|
|
14
24
|
return commands.ROSTER_MEMBER_ADD;
|
|
@@ -16,14 +26,18 @@ class PlannerRosterMemberAddCommand extends GraphCommand {
|
|
|
16
26
|
get description() {
|
|
17
27
|
return 'Adds a user to a Microsoft Planner Roster';
|
|
18
28
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
get schema() {
|
|
30
|
+
return options;
|
|
31
|
+
}
|
|
32
|
+
getRefinedSchema(schema) {
|
|
33
|
+
return schema
|
|
34
|
+
.refine(opts => [opts.userId, opts.userName].filter(x => x !== undefined).length === 1, {
|
|
35
|
+
message: `Specify exactly one of the following options: 'userId' or 'userName'.`,
|
|
36
|
+
params: {
|
|
37
|
+
customCode: 'optionSet',
|
|
38
|
+
options: ['userId', 'userName']
|
|
39
|
+
}
|
|
40
|
+
});
|
|
27
41
|
}
|
|
28
42
|
async commandAction(logger, args) {
|
|
29
43
|
if (this.verbose) {
|
|
@@ -50,7 +64,7 @@ class PlannerRosterMemberAddCommand extends GraphCommand {
|
|
|
50
64
|
}
|
|
51
65
|
async getUserId(logger, args) {
|
|
52
66
|
if (this.verbose) {
|
|
53
|
-
await logger.logToStderr(
|
|
67
|
+
await logger.logToStderr('Getting the user ID');
|
|
54
68
|
}
|
|
55
69
|
if (args.options.userId) {
|
|
56
70
|
return args.options.userId;
|
|
@@ -59,35 +73,5 @@ class PlannerRosterMemberAddCommand extends GraphCommand {
|
|
|
59
73
|
return userId;
|
|
60
74
|
}
|
|
61
75
|
}
|
|
62
|
-
_PlannerRosterMemberAddCommand_instances = new WeakSet(), _PlannerRosterMemberAddCommand_initTelemetry = function _PlannerRosterMemberAddCommand_initTelemetry() {
|
|
63
|
-
this.telemetry.push((args) => {
|
|
64
|
-
Object.assign(this.telemetryProperties, {
|
|
65
|
-
userId: typeof args.options.userId !== 'undefined',
|
|
66
|
-
userName: typeof args.options.userName !== 'undefined'
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
}, _PlannerRosterMemberAddCommand_initOptions = function _PlannerRosterMemberAddCommand_initOptions() {
|
|
70
|
-
this.options.unshift({
|
|
71
|
-
option: '--rosterId <rosterId>'
|
|
72
|
-
}, {
|
|
73
|
-
option: '--userId [userId]'
|
|
74
|
-
}, {
|
|
75
|
-
option: '--userName [userName]'
|
|
76
|
-
});
|
|
77
|
-
}, _PlannerRosterMemberAddCommand_initOptionSets = function _PlannerRosterMemberAddCommand_initOptionSets() {
|
|
78
|
-
this.optionSets.push({ options: ['userId', 'userName'] });
|
|
79
|
-
}, _PlannerRosterMemberAddCommand_initValidators = function _PlannerRosterMemberAddCommand_initValidators() {
|
|
80
|
-
this.validators.push(async (args) => {
|
|
81
|
-
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
82
|
-
return `${args.options.userId} is not a valid GUID`;
|
|
83
|
-
}
|
|
84
|
-
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
85
|
-
return `${args.options.userName} is not a valid user principal name (UPN)`;
|
|
86
|
-
}
|
|
87
|
-
return true;
|
|
88
|
-
});
|
|
89
|
-
}, _PlannerRosterMemberAddCommand_initTypes = function _PlannerRosterMemberAddCommand_initTypes() {
|
|
90
|
-
this.types.string.push('rosterId', 'userId', 'userName');
|
|
91
|
-
};
|
|
92
76
|
export default new PlannerRosterMemberAddCommand();
|
|
93
77
|
//# sourceMappingURL=roster-member-add.js.map
|
|
@@ -1,14 +1,24 @@
|
|
|
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 _PlannerRosterMemberGetCommand_instances, _PlannerRosterMemberGetCommand_initTelemetry, _PlannerRosterMemberGetCommand_initOptions, _PlannerRosterMemberGetCommand_initOptionSets, _PlannerRosterMemberGetCommand_initValidators, _PlannerRosterMemberGetCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
11
7
|
import { entraUser } from '../../../../utils/entraUser.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
rosterId: z.string(),
|
|
11
|
+
userId: z.string()
|
|
12
|
+
.refine(val => validation.isValidGuid(val), {
|
|
13
|
+
message: 'The value is not a valid GUID.'
|
|
14
|
+
})
|
|
15
|
+
.optional(),
|
|
16
|
+
userName: z.string()
|
|
17
|
+
.refine(val => validation.isValidUserPrincipalName(val), {
|
|
18
|
+
message: 'The value is not a valid user principal name (UPN).'
|
|
19
|
+
})
|
|
20
|
+
.optional()
|
|
21
|
+
});
|
|
12
22
|
class PlannerRosterMemberGetCommand extends GraphCommand {
|
|
13
23
|
get name() {
|
|
14
24
|
return commands.ROSTER_MEMBER_GET;
|
|
@@ -16,14 +26,18 @@ class PlannerRosterMemberGetCommand extends GraphCommand {
|
|
|
16
26
|
get description() {
|
|
17
27
|
return 'Gets a member of the specified Microsoft Planner Roster';
|
|
18
28
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
get schema() {
|
|
30
|
+
return options;
|
|
31
|
+
}
|
|
32
|
+
getRefinedSchema(schema) {
|
|
33
|
+
return schema
|
|
34
|
+
.refine(opts => [opts.userId, opts.userName].filter(x => x !== undefined).length === 1, {
|
|
35
|
+
message: `Specify exactly one of the following options: 'userId' or 'userName'.`,
|
|
36
|
+
params: {
|
|
37
|
+
customCode: 'optionSet',
|
|
38
|
+
options: ['userId', 'userName']
|
|
39
|
+
}
|
|
40
|
+
});
|
|
27
41
|
}
|
|
28
42
|
async commandAction(logger, args) {
|
|
29
43
|
if (this.verbose) {
|
|
@@ -52,35 +66,5 @@ class PlannerRosterMemberGetCommand extends GraphCommand {
|
|
|
52
66
|
return entraUser.getUserIdByUpn(args.options.userName);
|
|
53
67
|
}
|
|
54
68
|
}
|
|
55
|
-
_PlannerRosterMemberGetCommand_instances = new WeakSet(), _PlannerRosterMemberGetCommand_initTelemetry = function _PlannerRosterMemberGetCommand_initTelemetry() {
|
|
56
|
-
this.telemetry.push((args) => {
|
|
57
|
-
Object.assign(this.telemetryProperties, {
|
|
58
|
-
userId: typeof args.options.userId !== 'undefined',
|
|
59
|
-
userName: typeof args.options.userName !== 'undefined'
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}, _PlannerRosterMemberGetCommand_initOptions = function _PlannerRosterMemberGetCommand_initOptions() {
|
|
63
|
-
this.options.unshift({
|
|
64
|
-
option: '--rosterId <rosterId>'
|
|
65
|
-
}, {
|
|
66
|
-
option: '--userId [userId]'
|
|
67
|
-
}, {
|
|
68
|
-
option: '--userName [userName]'
|
|
69
|
-
});
|
|
70
|
-
}, _PlannerRosterMemberGetCommand_initOptionSets = function _PlannerRosterMemberGetCommand_initOptionSets() {
|
|
71
|
-
this.optionSets.push({ options: ['userId', 'userName'] });
|
|
72
|
-
}, _PlannerRosterMemberGetCommand_initValidators = function _PlannerRosterMemberGetCommand_initValidators() {
|
|
73
|
-
this.validators.push(async (args) => {
|
|
74
|
-
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
75
|
-
return `${args.options.userId} is not a valid GUID`;
|
|
76
|
-
}
|
|
77
|
-
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
78
|
-
return `${args.options.userName} is not a valid userName`;
|
|
79
|
-
}
|
|
80
|
-
return true;
|
|
81
|
-
});
|
|
82
|
-
}, _PlannerRosterMemberGetCommand_initTypes = function _PlannerRosterMemberGetCommand_initTypes() {
|
|
83
|
-
this.types.string.push('rosterId', 'userId', 'userName');
|
|
84
|
-
};
|
|
85
69
|
export default new PlannerRosterMemberGetCommand();
|
|
86
70
|
//# sourceMappingURL=roster-member-get.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
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 _PlannerRosterMemberListCommand_instances, _PlannerRosterMemberListCommand_initOptions, _PlannerRosterMemberListCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { odata } from '../../../../utils/odata.js';
|
|
8
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
9
5
|
import commands from '../../commands.js';
|
|
6
|
+
export const options = z.strictObject({
|
|
7
|
+
...globalOptionsZod.shape,
|
|
8
|
+
rosterId: z.string()
|
|
9
|
+
});
|
|
10
10
|
class PlannerRosterMemberListCommand extends GraphCommand {
|
|
11
11
|
get name() {
|
|
12
12
|
return commands.ROSTER_MEMBER_LIST;
|
|
@@ -14,11 +14,8 @@ class PlannerRosterMemberListCommand extends GraphCommand {
|
|
|
14
14
|
get description() {
|
|
15
15
|
return 'Lists members of the specified Microsoft Planner Roster';
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
_PlannerRosterMemberListCommand_instances.add(this);
|
|
20
|
-
__classPrivateFieldGet(this, _PlannerRosterMemberListCommand_instances, "m", _PlannerRosterMemberListCommand_initOptions).call(this);
|
|
21
|
-
__classPrivateFieldGet(this, _PlannerRosterMemberListCommand_instances, "m", _PlannerRosterMemberListCommand_initTypes).call(this);
|
|
17
|
+
get schema() {
|
|
18
|
+
return options;
|
|
22
19
|
}
|
|
23
20
|
async commandAction(logger, args) {
|
|
24
21
|
if (this.verbose) {
|
|
@@ -33,12 +30,5 @@ class PlannerRosterMemberListCommand extends GraphCommand {
|
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
|
-
_PlannerRosterMemberListCommand_instances = new WeakSet(), _PlannerRosterMemberListCommand_initOptions = function _PlannerRosterMemberListCommand_initOptions() {
|
|
37
|
-
this.options.unshift({
|
|
38
|
-
option: '--rosterId <rosterId>'
|
|
39
|
-
});
|
|
40
|
-
}, _PlannerRosterMemberListCommand_initTypes = function _PlannerRosterMemberListCommand_initTypes() {
|
|
41
|
-
this.types.string.push('rosterId');
|
|
42
|
-
};
|
|
43
33
|
export default new PlannerRosterMemberListCommand();
|
|
44
34
|
//# sourceMappingURL=roster-member-list.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 _PlannerRosterMemberRemoveCommand_instances, _PlannerRosterMemberRemoveCommand_initTelemetry, _PlannerRosterMemberRemoveCommand_initOptions, _PlannerRosterMemberRemoveCommand_initOptionSets, _PlannerRosterMemberRemoveCommand_initValidators, _PlannerRosterMemberRemoveCommand_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 { entraUser } from '../../../../utils/entraUser.js';
|
|
@@ -11,6 +7,21 @@ import { odata } from '../../../../utils/odata.js';
|
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
rosterId: z.string(),
|
|
13
|
+
userId: z.string()
|
|
14
|
+
.refine(val => validation.isValidGuid(val), {
|
|
15
|
+
message: 'The value is not a valid GUID.'
|
|
16
|
+
})
|
|
17
|
+
.optional(),
|
|
18
|
+
userName: z.string()
|
|
19
|
+
.refine(val => validation.isValidUserPrincipalName(val), {
|
|
20
|
+
message: 'The value is not a valid user principal name (UPN).'
|
|
21
|
+
})
|
|
22
|
+
.optional(),
|
|
23
|
+
force: z.boolean().optional().alias('f')
|
|
24
|
+
});
|
|
14
25
|
class PlannerRosterMemberRemoveCommand extends GraphCommand {
|
|
15
26
|
get name() {
|
|
16
27
|
return commands.ROSTER_MEMBER_REMOVE;
|
|
@@ -18,14 +29,18 @@ class PlannerRosterMemberRemoveCommand extends GraphCommand {
|
|
|
18
29
|
get description() {
|
|
19
30
|
return 'Removes a member from a Microsoft Planner Roster';
|
|
20
31
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
get schema() {
|
|
33
|
+
return options;
|
|
34
|
+
}
|
|
35
|
+
getRefinedSchema(schema) {
|
|
36
|
+
return schema
|
|
37
|
+
.refine(opts => [opts.userId, opts.userName].filter(x => x !== undefined).length === 1, {
|
|
38
|
+
message: `Specify exactly one of the following options: 'userId' or 'userName'.`,
|
|
39
|
+
params: {
|
|
40
|
+
customCode: 'optionSet',
|
|
41
|
+
options: ['userId', 'userName']
|
|
42
|
+
}
|
|
43
|
+
});
|
|
29
44
|
}
|
|
30
45
|
async commandAction(logger, args) {
|
|
31
46
|
if (this.verbose) {
|
|
@@ -70,45 +85,12 @@ class PlannerRosterMemberRemoveCommand extends GraphCommand {
|
|
|
70
85
|
if (!args.options.force) {
|
|
71
86
|
const rosterMembers = await odata.getAllItems(`${this.resource}/beta/planner/rosters/${args.options.rosterId}/members?$select=Id`);
|
|
72
87
|
if (rosterMembers.length === 1) {
|
|
73
|
-
const result = await cli.promptForConfirmation({ message:
|
|
88
|
+
const result = await cli.promptForConfirmation({ message: 'You are about to remove the last member of this Roster. When this happens, the Roster and all its contents will be deleted within 30 days. Are you sure you want to proceed?' });
|
|
74
89
|
return result;
|
|
75
90
|
}
|
|
76
91
|
}
|
|
77
92
|
return true;
|
|
78
93
|
}
|
|
79
94
|
}
|
|
80
|
-
_PlannerRosterMemberRemoveCommand_instances = new WeakSet(), _PlannerRosterMemberRemoveCommand_initTelemetry = function _PlannerRosterMemberRemoveCommand_initTelemetry() {
|
|
81
|
-
this.telemetry.push((args) => {
|
|
82
|
-
Object.assign(this.telemetryProperties, {
|
|
83
|
-
userId: typeof args.options.userId !== 'undefined',
|
|
84
|
-
userName: typeof args.options.userName !== 'undefined',
|
|
85
|
-
force: !!args.options.force
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
}, _PlannerRosterMemberRemoveCommand_initOptions = function _PlannerRosterMemberRemoveCommand_initOptions() {
|
|
89
|
-
this.options.unshift({
|
|
90
|
-
option: '--rosterId <rosterId>'
|
|
91
|
-
}, {
|
|
92
|
-
option: '--userId [userId]'
|
|
93
|
-
}, {
|
|
94
|
-
option: '--userName [userName]'
|
|
95
|
-
}, {
|
|
96
|
-
option: '-f, --force'
|
|
97
|
-
});
|
|
98
|
-
}, _PlannerRosterMemberRemoveCommand_initOptionSets = function _PlannerRosterMemberRemoveCommand_initOptionSets() {
|
|
99
|
-
this.optionSets.push({ options: ['userId', 'userName'] });
|
|
100
|
-
}, _PlannerRosterMemberRemoveCommand_initValidators = function _PlannerRosterMemberRemoveCommand_initValidators() {
|
|
101
|
-
this.validators.push(async (args) => {
|
|
102
|
-
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
103
|
-
return `${args.options.userId} is not a valid GUID`;
|
|
104
|
-
}
|
|
105
|
-
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
106
|
-
return `${args.options.userName} is not a valid userName`;
|
|
107
|
-
}
|
|
108
|
-
return true;
|
|
109
|
-
});
|
|
110
|
-
}, _PlannerRosterMemberRemoveCommand_initTypes = function _PlannerRosterMemberRemoveCommand_initTypes() {
|
|
111
|
-
this.types.string.push('rosterId', 'userId', 'userName');
|
|
112
|
-
};
|
|
113
95
|
export default new PlannerRosterMemberRemoveCommand();
|
|
114
96
|
//# sourceMappingURL=roster-member-remove.js.map
|
|
@@ -1,15 +1,24 @@
|
|
|
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 _PlannerRosterPlanListCommand_instances, _PlannerRosterPlanListCommand_initTelemetry, _PlannerRosterPlanListCommand_initOptions, _PlannerRosterPlanListCommand_initValidators, _PlannerRosterPlanListCommand_initTypes, _PlannerRosterPlanListCommand_initOptionSets;
|
|
7
1
|
import auth from '../../../../Auth.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
9
5
|
import commands from '../../commands.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.js';
|
|
11
7
|
import { accessToken } from '../../../../utils/accessToken.js';
|
|
12
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
userId: z.string()
|
|
12
|
+
.refine(val => validation.isValidGuid(val), {
|
|
13
|
+
message: 'The value is not a valid GUID.'
|
|
14
|
+
})
|
|
15
|
+
.optional(),
|
|
16
|
+
userName: z.string()
|
|
17
|
+
.refine(val => validation.isValidUserPrincipalName(val), {
|
|
18
|
+
message: 'The value is not a valid user principal name (UPN).'
|
|
19
|
+
})
|
|
20
|
+
.optional()
|
|
21
|
+
});
|
|
13
22
|
class PlannerRosterPlanListCommand extends GraphCommand {
|
|
14
23
|
get name() {
|
|
15
24
|
return commands.ROSTER_PLAN_LIST;
|
|
@@ -17,14 +26,18 @@ class PlannerRosterPlanListCommand extends GraphCommand {
|
|
|
17
26
|
get description() {
|
|
18
27
|
return 'Lists all Microsoft Planner Roster plans for a specific user';
|
|
19
28
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
get schema() {
|
|
30
|
+
return options;
|
|
31
|
+
}
|
|
32
|
+
getRefinedSchema(schema) {
|
|
33
|
+
return schema
|
|
34
|
+
.refine(opts => !opts.userId || !opts.userName, {
|
|
35
|
+
message: `Specify either 'userId' or 'userName', but not both.`,
|
|
36
|
+
params: {
|
|
37
|
+
customCode: 'optionSet',
|
|
38
|
+
options: ['userId', 'userName']
|
|
39
|
+
}
|
|
40
|
+
});
|
|
28
41
|
}
|
|
29
42
|
defaultProperties() {
|
|
30
43
|
return ['id', 'title', 'createdDateTime', 'owner'];
|
|
@@ -47,7 +60,7 @@ class PlannerRosterPlanListCommand extends GraphCommand {
|
|
|
47
60
|
else {
|
|
48
61
|
requestUrl += 'me';
|
|
49
62
|
}
|
|
50
|
-
requestUrl +=
|
|
63
|
+
requestUrl += '/planner/rosterPlans';
|
|
51
64
|
try {
|
|
52
65
|
const items = await odata.getAllItems(requestUrl);
|
|
53
66
|
await logger.log(items);
|
|
@@ -57,36 +70,5 @@ class PlannerRosterPlanListCommand extends GraphCommand {
|
|
|
57
70
|
}
|
|
58
71
|
}
|
|
59
72
|
}
|
|
60
|
-
_PlannerRosterPlanListCommand_instances = new WeakSet(), _PlannerRosterPlanListCommand_initTelemetry = function _PlannerRosterPlanListCommand_initTelemetry() {
|
|
61
|
-
this.telemetry.push((args) => {
|
|
62
|
-
Object.assign(this.telemetryProperties, {
|
|
63
|
-
userId: typeof args.options.userId !== 'undefined',
|
|
64
|
-
userName: typeof args.options.userName !== 'undefined'
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
}, _PlannerRosterPlanListCommand_initOptions = function _PlannerRosterPlanListCommand_initOptions() {
|
|
68
|
-
this.options.unshift({
|
|
69
|
-
option: '--userId [userId]'
|
|
70
|
-
}, {
|
|
71
|
-
option: '--userName [userName]'
|
|
72
|
-
});
|
|
73
|
-
}, _PlannerRosterPlanListCommand_initValidators = function _PlannerRosterPlanListCommand_initValidators() {
|
|
74
|
-
this.validators.push(async (args) => {
|
|
75
|
-
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
76
|
-
return `${args.options.userId} is not a valid GUID`;
|
|
77
|
-
}
|
|
78
|
-
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
79
|
-
return `${args.options.userName} is not a valid user principal name (UPN)`;
|
|
80
|
-
}
|
|
81
|
-
return true;
|
|
82
|
-
});
|
|
83
|
-
}, _PlannerRosterPlanListCommand_initTypes = function _PlannerRosterPlanListCommand_initTypes() {
|
|
84
|
-
this.types.string.push('userId', 'userName');
|
|
85
|
-
}, _PlannerRosterPlanListCommand_initOptionSets = function _PlannerRosterPlanListCommand_initOptionSets() {
|
|
86
|
-
this.optionSets.push({
|
|
87
|
-
options: ['userId', 'userName'],
|
|
88
|
-
runsWhen: (args) => args.options.userId || args.options.userName
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
73
|
export default new PlannerRosterPlanListCommand();
|
|
92
74
|
//# sourceMappingURL=roster-plan-list.js.map
|