@pnp/cli-microsoft365 11.4.0-beta.87732f5 → 11.4.0-beta.f54089d
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/.devproxy/api-specs/sharepoint.yaml +43 -0
- package/README.md +1 -1
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +1 -1
- package/dist/AuthServer.js +2 -4
- package/dist/Command.js +2 -2
- package/dist/cli/cli.js +9 -9
- package/dist/m365/adaptivecard/commands/adaptivecard-send.js +10 -11
- package/dist/m365/app/commands/app-open.js +3 -4
- package/dist/m365/app/commands/permission/permission-add.js +4 -5
- package/dist/m365/base/AppCommand.js +3 -3
- package/dist/m365/booking/commands/business/business-get.js +6 -8
- package/dist/m365/booking/commands/business/business-list.js +2 -1
- package/dist/m365/cli/commands/app/app-add.js +5 -7
- package/dist/m365/commands/docs.js +1 -1
- package/dist/m365/commands/login.js +22 -19
- package/dist/m365/commands/logout.js +1 -1
- package/dist/m365/commands/status.js +2 -1
- package/dist/m365/connection/commands/connection-list.js +2 -1
- package/dist/m365/connection/commands/connection-set.js +15 -29
- package/dist/m365/context/commands/context-remove.js +4 -6
- package/dist/m365/context/commands/option/option-remove.js +5 -7
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-add.js +5 -7
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +7 -9
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +4 -5
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-remove.js +8 -10
- package/dist/m365/entra/commands/license/license-list.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-remove.js +1 -1
- package/dist/m365/entra/commands/multitenant/multitenant-add.js +3 -4
- package/dist/m365/entra/commands/organization/organization-list.js +4 -6
- package/dist/m365/entra/commands/organization/organization-set.js +24 -26
- package/dist/m365/entra/commands/roleassignment/roleassignment-add.js +21 -34
- package/dist/m365/entra/commands/roledefinition/roledefinition-add.js +8 -10
- package/dist/m365/entra/commands/roledefinition/roledefinition-get.js +11 -13
- package/dist/m365/entra/commands/roledefinition/roledefinition-list.js +5 -7
- package/dist/m365/entra/commands/roledefinition/roledefinition-remove.js +11 -13
- package/dist/m365/entra/commands/roledefinition/roledefinition-set.js +15 -17
- package/dist/m365/entra/commands/rolepermission/rolepermission-list.js +5 -7
- package/dist/m365/entra/commands/user/user-session-revoke.js +9 -13
- package/dist/m365/exo/commands/approleassignment/approleassignment-add.js +29 -31
- package/dist/m365/flow/commands/environment/environment-get.js +5 -7
- package/dist/m365/flow/commands/environment/environment-list.js +2 -1
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-list.js +4 -6
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-restore.js +5 -11
- package/dist/m365/graph/commands/directoryextension/directoryextension-add.js +11 -13
- package/dist/m365/graph/commands/directoryextension/directoryextension-get.js +10 -19
- package/dist/m365/graph/commands/directoryextension/directoryextension-list.js +6 -12
- package/dist/m365/graph/commands/directoryextension/directoryextension-remove.js +11 -20
- package/dist/m365/graph/commands/openextension/openextension-add.js +12 -13
- package/dist/m365/graph/commands/openextension/openextension-get.js +12 -14
- package/dist/m365/graph/commands/openextension/openextension-list.js +11 -13
- package/dist/m365/graph/commands/openextension/openextension-remove.js +13 -15
- package/dist/m365/graph/commands/openextension/openextension-set.js +16 -17
- package/dist/m365/onedrive/commands/onedrive-list.js +2 -1
- package/dist/m365/outlook/commands/mail/mail-searchfolder-add.js +9 -14
- package/dist/m365/outlook/commands/mailbox/mailbox-settings-get.js +8 -12
- package/dist/m365/outlook/commands/mailbox/mailbox-settings-set.js +15 -15
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +2 -1
- package/dist/m365/pa/commands/environment/environment-get.js +5 -7
- package/dist/m365/pa/commands/environment/environment-list.js +2 -1
- package/dist/m365/planner/commands/tenant/tenant-settings-list.js +1 -1
- package/dist/m365/pp/commands/environment/environment-get.js +5 -7
- package/dist/m365/pp/commands/environment/environment-list.js +3 -4
- package/dist/m365/pp/commands/gateway/gateway-list.js +1 -1
- package/dist/m365/pp/commands/tenant/tenant-settings-list.js +1 -1
- package/dist/m365/pp/commands/website/website-get.js +12 -12
- package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +2 -1
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +1 -1
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +1 -1
- package/dist/m365/spe/commands/container/container-add.js +10 -15
- package/dist/m365/spe/commands/container/container-permission-list.js +4 -6
- package/dist/m365/spe/commands/container/container-recyclebinitem-list.js +5 -10
- package/dist/m365/spe/commands/container/container-recyclebinitem-restore.js +7 -12
- package/dist/m365/spe/commands/container/container-remove.js +10 -16
- package/dist/m365/spe/commands/containertype/containertype-add.js +15 -20
- package/dist/m365/spe/commands/containertype/containertype-get.js +6 -13
- package/dist/m365/spe/commands/containertype/containertype-remove.js +7 -14
- package/dist/m365/spfx/commands/project/project-upgrade/rules/DependencyRule.js +56 -14
- package/dist/m365/spfx/commands/project/project-upgrade.js +4 -6
- package/dist/m365/spo/commands/file/file-add.js +49 -11
- package/dist/m365/spo/commands/file/file-version-keep.js +10 -14
- package/dist/m365/spo/commands/homesite/homesite-add.js +13 -15
- package/dist/m365/spo/commands/homesite/homesite-get.js +8 -9
- package/dist/m365/spo/commands/homesite/homesite-remove.js +9 -10
- package/dist/m365/spo/commands/homesite/homesite-set.js +13 -14
- package/dist/m365/spo/commands/list/DefaultColumnValue.js +2 -0
- package/dist/m365/spo/commands/list/list-defaultvalue-clear.js +13 -17
- package/dist/m365/spo/commands/list/list-defaultvalue-get.js +124 -0
- package/dist/m365/spo/commands/list/list-defaultvalue-list.js +13 -37
- package/dist/m365/spo/commands/list/list-defaultvalue-remove.js +12 -16
- package/dist/m365/spo/commands/list/list-defaultvalue-set.js +11 -15
- package/dist/m365/spo/commands/list/list-view-add.js +16 -20
- package/dist/m365/spo/commands/listitem/listitem-set.js +1 -1
- package/dist/m365/spo/commands/page/page-control-remove.js +11 -15
- package/dist/m365/spo/commands/page/page-get.js +10 -11
- package/dist/m365/spo/commands/page/page-header-set.js +97 -89
- package/dist/m365/spo/commands/page/page-publish.js +9 -10
- package/dist/m365/spo/commands/page/page-section-remove.js +11 -12
- package/dist/m365/spo/commands/page/page-set.js +26 -26
- package/dist/m365/spo/commands/site/site-appcatalog-list.js +4 -6
- package/dist/m365/spo/commands/site/site-get.js +6 -8
- package/dist/m365/spo/commands/site/site-sharingpermission-set.js +7 -9
- package/dist/m365/spo/commands/site/site-versionpolicy-get.js +11 -13
- package/dist/m365/spo/commands/web/web-alert-list.js +20 -27
- package/dist/m365/spo/commands/web/web-alert-remove.js +15 -20
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/spp/commands/model/model-apply.js +18 -24
- package/dist/m365/teams/commands/callrecord/callrecord-list.js +5 -9
- package/dist/m365/teams/commands/chat/chat-message-list.js +26 -27
- package/dist/m365/teams/commands/chat/chat-message-send.js +12 -3
- package/dist/m365/teams/commands/chat/chatUtil.js +1 -1
- package/dist/m365/tenant/commands/people/people-pronouns-set.js +4 -6
- package/dist/m365/tenant/commands/report/report-settings-set.js +4 -6
- package/dist/m365/viva/commands/engage/engage-community-user-add.js +17 -22
- package/dist/m365/viva/commands/engage/engage-community-user-list.js +8 -14
- package/dist/m365/viva/commands/engage/engage-community-user-remove.js +14 -22
- package/dist/m365/viva/commands/engage/engage-role-member-list.js +6 -11
- package/dist/utils/spo.js +30 -2
- package/dist/utils/zod.js +41 -76
- package/docs/docs/cmd/entra/app/app-permission-add.mdx +19 -0
- package/docs/docs/cmd/entra/app/app-permission-list.mdx +19 -0
- package/docs/docs/cmd/entra/app/app-permission-remove.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-add.mdx +140 -1
- package/docs/docs/cmd/spo/list/list-defaultvalue-get.mdx +118 -0
- package/docs/docs/cmd/spo/page/page-header-set.mdx +28 -8
- package/docs/docs/cmd/spo/page/page-set.mdx +35 -5
- package/docs/docs/cmd/teams/chat/chat-message-list.mdx +34 -7
- package/docs/docs/cmd/teams/chat/chat-message-send.mdx +23 -1
- package/npm-shrinkwrap.json +274 -248
- package/package.json +12 -11
|
@@ -3,11 +3,10 @@ import { globalOptionsZod } from '../../../../Command.js';
|
|
|
3
3
|
import request from '../../../../request.js';
|
|
4
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
5
5
|
import commands from '../../commands.js';
|
|
6
|
-
|
|
7
|
-
const options = globalOptionsZod
|
|
6
|
+
export const options = globalOptionsZod
|
|
8
7
|
.extend({
|
|
9
|
-
displayName:
|
|
10
|
-
description:
|
|
8
|
+
displayName: z.string().alias('n'),
|
|
9
|
+
description: z.string().optional().alias('d')
|
|
11
10
|
}).strict();
|
|
12
11
|
class EntraMultitenantAddCommand extends GraphCommand {
|
|
13
12
|
get name() {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
5
|
import { odata } from '../../../../utils/odata.js';
|
|
7
|
-
const options =
|
|
8
|
-
.
|
|
9
|
-
properties:
|
|
10
|
-
})
|
|
11
|
-
.strict();
|
|
6
|
+
export const options = z.strictObject({
|
|
7
|
+
...globalOptionsZod.shape,
|
|
8
|
+
properties: z.string().optional().alias('p')
|
|
9
|
+
});
|
|
12
10
|
class EntraOrganizationListCommand extends GraphCommand {
|
|
13
11
|
get name() {
|
|
14
12
|
return commands.ORGANIZATION_LIST;
|
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
5
|
import { validation } from '../../../../utils/validation.js';
|
|
7
6
|
import request from '../../../../request.js';
|
|
8
7
|
import { odata } from '../../../../utils/odata.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
11
|
-
id:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
message: `The following security compliance notification emails are invalid: ${invalidEmails}.`
|
|
20
|
-
})).transform((value) => value.split(',')).optional(),
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
id: z.uuid().optional().alias('i'),
|
|
11
|
+
displayName: z.string().optional().alias('d'),
|
|
12
|
+
marketingNotificationEmails: z.string().refine(emails => validation.isValidUserPrincipalNameArray(emails) === true, {
|
|
13
|
+
error: e => `The following marketing notification emails are invalid: ${e.input}.`
|
|
14
|
+
}).transform((value) => value.split(',')).optional(),
|
|
15
|
+
securityComplianceNotificationMails: z.string().refine(emails => validation.isValidUserPrincipalNameArray(emails) === true, {
|
|
16
|
+
error: e => `The following security compliance notification emails are invalid: ${e.input}.`
|
|
17
|
+
}).transform((value) => value.split(',')).optional(),
|
|
21
18
|
securityComplianceNotificationPhones: z.string().transform((value) => value.split(',')).optional(),
|
|
22
|
-
technicalNotificationMails: z.string().refine(emails => validation.isValidUserPrincipalNameArray(emails) === true,
|
|
23
|
-
|
|
24
|
-
})
|
|
25
|
-
contactEmail: z.string().refine(id => validation.isValidUserPrincipalName(id),
|
|
26
|
-
|
|
27
|
-
})
|
|
19
|
+
technicalNotificationMails: z.string().refine(emails => validation.isValidUserPrincipalNameArray(emails) === true, {
|
|
20
|
+
error: e => `The following technical notification emails are invalid: ${e.input}.`
|
|
21
|
+
}).transform((value) => value.split(',')).optional(),
|
|
22
|
+
contactEmail: z.string().refine(id => validation.isValidUserPrincipalName(id), {
|
|
23
|
+
error: e => `'${e.input}' is not a valid email.`
|
|
24
|
+
}).optional(),
|
|
28
25
|
statementUrl: z.string().optional()
|
|
29
|
-
})
|
|
30
|
-
.strict();
|
|
26
|
+
});
|
|
31
27
|
class EntraOrganizationSetCommand extends GraphCommand {
|
|
32
28
|
get name() {
|
|
33
29
|
return commands.ORGANIZATION_SET;
|
|
@@ -41,14 +37,16 @@ class EntraOrganizationSetCommand extends GraphCommand {
|
|
|
41
37
|
getRefinedSchema(schema) {
|
|
42
38
|
return schema
|
|
43
39
|
.refine(options => !(options.id && options.displayName), {
|
|
44
|
-
|
|
40
|
+
error: 'Specify either id or displayName, but not both'
|
|
45
41
|
})
|
|
46
42
|
.refine(options => options.id || options.displayName, {
|
|
47
|
-
|
|
43
|
+
error: 'Specify either id or displayName'
|
|
48
44
|
})
|
|
49
|
-
.refine(options => [
|
|
50
|
-
options.
|
|
51
|
-
|
|
45
|
+
.refine(options => [
|
|
46
|
+
options.contactEmail, options.marketingNotificationEmails, options.securityComplianceNotificationMails, options.securityComplianceNotificationPhones,
|
|
47
|
+
options.statementUrl, options.technicalNotificationMails
|
|
48
|
+
].filter(o => o !== undefined).length > 0, {
|
|
49
|
+
error: 'Specify at least one of the following options: contactEmail, marketingNotificationEmails, securityComplianceNotificationMails, securityComplianceNotificationPhones, statementUrl, or technicalNotificationMails'
|
|
52
50
|
});
|
|
53
51
|
}
|
|
54
52
|
async commandAction(logger, args) {
|
|
@@ -10,42 +10,27 @@ import { entraServicePrincipal } from '../../../../utils/entraServicePrincipal.j
|
|
|
10
10
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
11
11
|
import { roleDefinition } from '../../../../utils/roleDefinition.js';
|
|
12
12
|
import { entraUser } from '../../../../utils/entraUser.js';
|
|
13
|
-
const options =
|
|
14
|
-
.
|
|
15
|
-
roleDefinitionId: z.
|
|
16
|
-
message: `'${id}' is not a valid GUID.`
|
|
17
|
-
})).optional(),
|
|
13
|
+
export const options = z.strictObject({
|
|
14
|
+
...globalOptionsZod.shape,
|
|
15
|
+
roleDefinitionId: z.uuid().optional(),
|
|
18
16
|
roleDefinitionName: z.string().optional(),
|
|
19
|
-
principal: z.string().refine(principal => validation.isValidGuid(principal) || validation.isValidUserPrincipalName(principal) || validation.isValidMailNickname(principal),
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
userId: z.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})).optional(),
|
|
28
|
-
administrativeUnitId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
29
|
-
message: `'${id}' is not a valid GUID.`
|
|
30
|
-
})).optional(),
|
|
17
|
+
principal: z.string().refine(principal => validation.isValidGuid(principal) || validation.isValidUserPrincipalName(principal) || validation.isValidMailNickname(principal), {
|
|
18
|
+
error: e => `'${e.input}' is not a valid GUID, UPN or group mail nickname.`
|
|
19
|
+
}),
|
|
20
|
+
userId: z.uuid().optional(),
|
|
21
|
+
userName: z.string().refine(upn => validation.isValidUserPrincipalName(upn), {
|
|
22
|
+
error: e => `'${e.input}' is not a valid UPN.`
|
|
23
|
+
}).optional(),
|
|
24
|
+
administrativeUnitId: z.uuid().optional(),
|
|
31
25
|
administrativeUnitName: z.string().optional(),
|
|
32
|
-
applicationId: z.
|
|
33
|
-
|
|
34
|
-
})).optional(),
|
|
35
|
-
applicationObjectId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
36
|
-
message: `'${id}' is not a valid GUID.`
|
|
37
|
-
})).optional(),
|
|
26
|
+
applicationId: z.uuid().optional(),
|
|
27
|
+
applicationObjectId: z.uuid().optional(),
|
|
38
28
|
applicationName: z.string().optional(),
|
|
39
|
-
servicePrincipalId: z.
|
|
40
|
-
message: `'${id}' is not a valid GUID.`
|
|
41
|
-
})).optional(),
|
|
29
|
+
servicePrincipalId: z.uuid().optional(),
|
|
42
30
|
servicePrincipalName: z.string().optional(),
|
|
43
|
-
groupId: z.
|
|
44
|
-
message: `'${id}' is not a valid GUID.`
|
|
45
|
-
})).optional(),
|
|
31
|
+
groupId: z.uuid().optional(),
|
|
46
32
|
groupName: z.string().optional()
|
|
47
|
-
})
|
|
48
|
-
.strict();
|
|
33
|
+
});
|
|
49
34
|
class EntraRoleAssignmentAddCommand extends GraphCommand {
|
|
50
35
|
get name() {
|
|
51
36
|
return commands.ROLEASSIGNMENT_ADD;
|
|
@@ -59,10 +44,12 @@ class EntraRoleAssignmentAddCommand extends GraphCommand {
|
|
|
59
44
|
getRefinedSchema(schema) {
|
|
60
45
|
return schema
|
|
61
46
|
.refine(options => [options.roleDefinitionId, options.roleDefinitionName].filter(o => o !== undefined).length === 1, {
|
|
62
|
-
|
|
47
|
+
error: 'Specify either roleDefinitionId or roleDefinitionName'
|
|
63
48
|
})
|
|
64
|
-
.refine(options => Object.values([
|
|
65
|
-
options.
|
|
49
|
+
.refine(options => Object.values([
|
|
50
|
+
options.userId, options.userName, options.administrativeUnitId, options.administrativeUnitName, options.applicationId, options.applicationObjectId, options.applicationName,
|
|
51
|
+
options.servicePrincipalId, options.servicePrincipalName, options.groupId, options.groupName
|
|
52
|
+
]).filter(v => typeof v !== 'undefined').length < 2, {
|
|
66
53
|
message: 'Provide value for only one of the following parameters: userId, userName, administrativeUnitId, administrativeUnitName, applicationId, applicationObjectId, applicationName, servicePrincipalId, servicePrincipalName, groupId or groupName'
|
|
67
54
|
});
|
|
68
55
|
}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
5
|
import request from '../../../../request.js';
|
|
7
|
-
const options =
|
|
8
|
-
.
|
|
9
|
-
displayName:
|
|
10
|
-
allowedResourceActions:
|
|
11
|
-
description:
|
|
12
|
-
enabled:
|
|
13
|
-
version:
|
|
14
|
-
})
|
|
15
|
-
.strict();
|
|
6
|
+
export const options = z.strictObject({
|
|
7
|
+
...globalOptionsZod.shape,
|
|
8
|
+
displayName: z.string().alias('n'),
|
|
9
|
+
allowedResourceActions: z.string().transform((value) => value.split(',').map(String)).alias('a'),
|
|
10
|
+
description: z.string().optional().alias('d'),
|
|
11
|
+
enabled: z.boolean().optional().alias('e'),
|
|
12
|
+
version: z.string().optional().alias('v')
|
|
13
|
+
});
|
|
16
14
|
class EntraRoleDefinitionAddCommand extends GraphCommand {
|
|
17
15
|
get name() {
|
|
18
16
|
return commands.ROLEDEFINITION_ADD;
|
|
@@ -2,16 +2,14 @@ import GraphCommand from '../../../base/GraphCommand.js';
|
|
|
2
2
|
import commands from '../../commands.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
5
|
-
import { zod } from '../../../../utils/zod.js';
|
|
6
5
|
import { roleDefinition } from '../../../../utils/roleDefinition.js';
|
|
7
6
|
import { validation } from '../../../../utils/validation.js';
|
|
8
|
-
const options =
|
|
9
|
-
.
|
|
10
|
-
id:
|
|
11
|
-
displayName:
|
|
12
|
-
properties:
|
|
13
|
-
})
|
|
14
|
-
.strict();
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
id: z.uuid().optional().alias('i'),
|
|
10
|
+
displayName: z.string().optional().alias('n'),
|
|
11
|
+
properties: z.string().optional().alias('p')
|
|
12
|
+
});
|
|
15
13
|
class EntraRoleDefinitionGetCommand extends GraphCommand {
|
|
16
14
|
get name() {
|
|
17
15
|
return commands.ROLEDEFINITION_GET;
|
|
@@ -25,15 +23,15 @@ class EntraRoleDefinitionGetCommand extends GraphCommand {
|
|
|
25
23
|
getRefinedSchema(schema) {
|
|
26
24
|
return schema
|
|
27
25
|
.refine(options => !options.id !== !options.displayName, {
|
|
28
|
-
|
|
26
|
+
error: 'Specify either id or displayName, but not both'
|
|
29
27
|
})
|
|
30
28
|
.refine(options => options.id || options.displayName, {
|
|
31
|
-
|
|
29
|
+
error: 'Specify either id or displayName'
|
|
32
30
|
})
|
|
33
|
-
.refine(options => (!options.id && !options.displayName) || options.displayName || (options.id && validation.isValidGuid(options.id)),
|
|
34
|
-
|
|
31
|
+
.refine(options => (!options.id && !options.displayName) || options.displayName || (options.id && validation.isValidGuid(options.id)), {
|
|
32
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
35
33
|
path: ['id']
|
|
36
|
-
})
|
|
34
|
+
});
|
|
37
35
|
}
|
|
38
36
|
async commandAction(logger, args) {
|
|
39
37
|
if (this.verbose) {
|
|
@@ -3,13 +3,11 @@ import GraphCommand from '../../../base/GraphCommand.js';
|
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
12
|
-
.strict();
|
|
6
|
+
export const options = z.strictObject({
|
|
7
|
+
...globalOptionsZod.shape,
|
|
8
|
+
properties: z.string().optional().alias('p'),
|
|
9
|
+
filter: z.string().optional().alias('f')
|
|
10
|
+
});
|
|
13
11
|
class EntraRoleDefinitionListCommand extends GraphCommand {
|
|
14
12
|
get name() {
|
|
15
13
|
return commands.ROLEDEFINITION_LIST;
|
|
@@ -2,18 +2,16 @@ import GraphCommand from '../../../base/GraphCommand.js';
|
|
|
2
2
|
import commands from '../../commands.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
5
|
-
import { zod } from '../../../../utils/zod.js';
|
|
6
5
|
import { roleDefinition } from '../../../../utils/roleDefinition.js';
|
|
7
6
|
import { validation } from '../../../../utils/validation.js';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { cli } from '../../../../cli/cli.js';
|
|
10
|
-
const options =
|
|
11
|
-
.
|
|
12
|
-
id:
|
|
13
|
-
displayName:
|
|
14
|
-
force:
|
|
15
|
-
})
|
|
16
|
-
.strict();
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
id: z.uuid().optional().alias('i'),
|
|
12
|
+
displayName: z.string().optional().alias('n'),
|
|
13
|
+
force: z.boolean().optional().alias('f')
|
|
14
|
+
});
|
|
17
15
|
class EntraRoleDefinitionRemoveCommand extends GraphCommand {
|
|
18
16
|
get name() {
|
|
19
17
|
return commands.ROLEDEFINITION_REMOVE;
|
|
@@ -27,15 +25,15 @@ class EntraRoleDefinitionRemoveCommand extends GraphCommand {
|
|
|
27
25
|
getRefinedSchema(schema) {
|
|
28
26
|
return schema
|
|
29
27
|
.refine(options => !options.id !== !options.displayName, {
|
|
30
|
-
|
|
28
|
+
error: 'Specify either id or displayName, but not both'
|
|
31
29
|
})
|
|
32
30
|
.refine(options => options.id || options.displayName, {
|
|
33
|
-
|
|
31
|
+
error: 'Specify either id or displayName'
|
|
34
32
|
})
|
|
35
|
-
.refine(options => (!options.id && !options.displayName) || options.displayName || (options.id && validation.isValidGuid(options.id)),
|
|
36
|
-
|
|
33
|
+
.refine(options => (!options.id && !options.displayName) || options.displayName || (options.id && validation.isValidGuid(options.id)), {
|
|
34
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
37
35
|
path: ['id']
|
|
38
|
-
})
|
|
36
|
+
});
|
|
39
37
|
}
|
|
40
38
|
async commandAction(logger, args) {
|
|
41
39
|
const removeRoleDefinition = async () => {
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
5
|
import request from '../../../../request.js';
|
|
7
6
|
import { roleDefinition } from '../../../../utils/roleDefinition.js';
|
|
8
7
|
import { validation } from '../../../../utils/validation.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
11
|
-
id:
|
|
12
|
-
displayName:
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
id: z.uuid().optional().alias('i'),
|
|
11
|
+
displayName: z.string().optional().alias('n'),
|
|
13
12
|
newDisplayName: z.string().optional(),
|
|
14
|
-
allowedResourceActions:
|
|
15
|
-
description:
|
|
16
|
-
enabled:
|
|
17
|
-
version:
|
|
18
|
-
})
|
|
19
|
-
.strict();
|
|
13
|
+
allowedResourceActions: z.string().optional().alias('a'),
|
|
14
|
+
description: z.string().optional().alias('d'),
|
|
15
|
+
enabled: z.boolean().optional().alias('e'),
|
|
16
|
+
version: z.string().optional().alias('v')
|
|
17
|
+
});
|
|
20
18
|
class EntraRoleDefinitionSetCommand extends GraphCommand {
|
|
21
19
|
get name() {
|
|
22
20
|
return commands.ROLEDEFINITION_SET;
|
|
@@ -30,17 +28,17 @@ class EntraRoleDefinitionSetCommand extends GraphCommand {
|
|
|
30
28
|
getRefinedSchema(schema) {
|
|
31
29
|
return schema
|
|
32
30
|
.refine(options => !options.id !== !options.displayName, {
|
|
33
|
-
|
|
31
|
+
error: 'Specify either id or displayName, but not both'
|
|
34
32
|
})
|
|
35
33
|
.refine(options => options.id || options.displayName, {
|
|
36
|
-
|
|
34
|
+
error: 'Specify either id or displayName'
|
|
37
35
|
})
|
|
38
|
-
.refine(options => (!options.id && !options.displayName) || options.displayName || (options.id && validation.isValidGuid(options.id)),
|
|
39
|
-
|
|
36
|
+
.refine(options => (!options.id && !options.displayName) || options.displayName || (options.id && validation.isValidGuid(options.id)), {
|
|
37
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
40
38
|
path: ['id']
|
|
41
|
-
})
|
|
39
|
+
})
|
|
42
40
|
.refine(options => Object.values([options.newDisplayName, options.description, options.allowedResourceActions, options.enabled, options.version]).filter(v => typeof v !== 'undefined').length > 0, {
|
|
43
|
-
|
|
41
|
+
error: 'Provide value for at least one of the following parameters: newDisplayName, description, allowedResourceActions, enabled or version'
|
|
44
42
|
});
|
|
45
43
|
}
|
|
46
44
|
async commandAction(logger, args) {
|
|
@@ -3,13 +3,11 @@ import GraphCommand from '../../../base/GraphCommand.js';
|
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
12
|
-
.strict();
|
|
6
|
+
export const options = z.strictObject({
|
|
7
|
+
...globalOptionsZod.shape,
|
|
8
|
+
resourceNamespace: z.string().alias('n'),
|
|
9
|
+
privileged: z.boolean().optional().alias('p')
|
|
10
|
+
});
|
|
13
11
|
class EntraRolePermissionListCommand extends GraphCommand {
|
|
14
12
|
get name() {
|
|
15
13
|
return commands.ROLEPERMISSION_LIST;
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
5
|
import { validation } from '../../../../utils/validation.js';
|
|
7
6
|
import request from '../../../../request.js';
|
|
8
7
|
import { cli } from '../../../../cli/cli.js';
|
|
9
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
-
const options =
|
|
11
|
-
.
|
|
12
|
-
userId:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
force: zod.alias('f', z.boolean().optional())
|
|
19
|
-
})
|
|
20
|
-
.strict();
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
userId: z.uuid().optional().alias('i'),
|
|
12
|
+
userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
13
|
+
error: e => `'${e.input}' is not a valid UPN.`
|
|
14
|
+
}).optional().alias('n'),
|
|
15
|
+
force: z.boolean().optional().alias('f')
|
|
16
|
+
});
|
|
21
17
|
class EntraUserSessionRevokeCommand extends GraphCommand {
|
|
22
18
|
get name() {
|
|
23
19
|
return commands.USER_SESSION_REVOKE;
|
|
@@ -31,7 +27,7 @@ class EntraUserSessionRevokeCommand extends GraphCommand {
|
|
|
31
27
|
getRefinedSchema(schema) {
|
|
32
28
|
return schema
|
|
33
29
|
.refine(options => [options.userId, options.userName].filter(o => o !== undefined).length === 1, {
|
|
34
|
-
|
|
30
|
+
error: `Specify either 'userId' or 'userName'.`
|
|
35
31
|
});
|
|
36
32
|
}
|
|
37
33
|
async commandAction(logger, args) {
|
|
@@ -9,15 +9,14 @@ import { entraUser } from '../../../../utils/entraUser.js';
|
|
|
9
9
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
10
10
|
import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js';
|
|
11
11
|
import { entraServicePrincipal } from '../../../../utils/entraServicePrincipal.js';
|
|
12
|
-
import { zod } from '../../../../utils/zod.js';
|
|
13
12
|
import { customAppScope } from '../../../../utils/customAppScope.js';
|
|
14
|
-
const options =
|
|
15
|
-
.
|
|
13
|
+
export const options = z.strictObject({
|
|
14
|
+
...globalOptionsZod.shape,
|
|
16
15
|
roleDefinitionId: z.string().optional(),
|
|
17
16
|
roleDefinitionName: z.string().optional(),
|
|
18
17
|
principalId: z.string().optional(),
|
|
19
18
|
principalName: z.string().optional(),
|
|
20
|
-
scope:
|
|
19
|
+
scope: z.enum(['tenant', 'user', 'group', 'administrativeUnit', 'custom']).alias('s'),
|
|
21
20
|
userId: z.string().optional(),
|
|
22
21
|
userName: z.string().optional(),
|
|
23
22
|
groupId: z.string().optional(),
|
|
@@ -26,8 +25,7 @@ const options = globalOptionsZod
|
|
|
26
25
|
administrativeUnitName: z.string().optional(),
|
|
27
26
|
customAppScopeId: z.string().optional(),
|
|
28
27
|
customAppScopeName: z.string().optional()
|
|
29
|
-
})
|
|
30
|
-
.strict();
|
|
28
|
+
});
|
|
31
29
|
class ExoAppRoleAssignmentAddCommand extends GraphCommand {
|
|
32
30
|
get name() {
|
|
33
31
|
return commands.APPROLEASSIGNMENT_ADD;
|
|
@@ -41,25 +39,25 @@ class ExoAppRoleAssignmentAddCommand extends GraphCommand {
|
|
|
41
39
|
getRefinedSchema(schema) {
|
|
42
40
|
return schema
|
|
43
41
|
.refine(options => !options.roleDefinitionId !== !options.roleDefinitionName, {
|
|
44
|
-
|
|
42
|
+
error: 'Specify either roleDefinitionId or roleDefinitionName, but not both'
|
|
45
43
|
})
|
|
46
44
|
.refine(options => options.roleDefinitionId || options.roleDefinitionName, {
|
|
47
|
-
|
|
45
|
+
error: 'Specify either roleDefinitionId or roleDefinitionName'
|
|
48
46
|
})
|
|
49
|
-
.refine(options => (!options.roleDefinitionId && !options.roleDefinitionName) || options.roleDefinitionName || (options.roleDefinitionId && validation.isValidGuid(options.roleDefinitionId)),
|
|
50
|
-
|
|
47
|
+
.refine(options => (!options.roleDefinitionId && !options.roleDefinitionName) || options.roleDefinitionName || (options.roleDefinitionId && validation.isValidGuid(options.roleDefinitionId)), {
|
|
48
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
51
49
|
path: ['roleDefinitionId']
|
|
52
|
-
})
|
|
50
|
+
})
|
|
53
51
|
.refine(options => !options.principalId !== !options.principalName, {
|
|
54
|
-
|
|
52
|
+
error: 'Specify either principalId or principalName, but not both'
|
|
55
53
|
})
|
|
56
54
|
.refine(options => options.principalId || options.principalName, {
|
|
57
|
-
|
|
55
|
+
error: 'Specify either principalId or principalName'
|
|
58
56
|
})
|
|
59
|
-
.refine(options => (!options.principalId && !options.principalName) || options.principalName || (options.principalId && validation.isValidGuid(options.principalId)),
|
|
60
|
-
|
|
57
|
+
.refine(options => (!options.principalId && !options.principalName) || options.principalName || (options.principalId && validation.isValidGuid(options.principalId)), {
|
|
58
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
61
59
|
path: ['principalId']
|
|
62
|
-
})
|
|
60
|
+
})
|
|
63
61
|
.refine(options => options.scope !== 'tenant' || Object.values([options.userId, options.userName, options.groupId, options.groupName, options.administrativeUnitId, options.administrativeUnitName, options.customAppScopeId, options.customAppScopeName]).filter(v => typeof v !== 'undefined').length === 0, {
|
|
64
62
|
message: "When the scope is set to 'tenant' then do not specify neither userId, userName, groupId, groupName, administrativeUnitId, administrativeUnitName, customAppScopeId nor customAppScopeName",
|
|
65
63
|
path: ['scope']
|
|
@@ -76,14 +74,14 @@ class ExoAppRoleAssignmentAddCommand extends GraphCommand {
|
|
|
76
74
|
message: "When the scope is set to 'user' specify either userId or userName",
|
|
77
75
|
path: ['scope']
|
|
78
76
|
})
|
|
79
|
-
.refine(options => options.scope !== 'user' || (!options.userId && !options.userName) || options.userName || (options.userId && validation.isValidGuid(options.userId)),
|
|
80
|
-
|
|
77
|
+
.refine(options => options.scope !== 'user' || (!options.userId && !options.userName) || options.userName || (options.userId && validation.isValidGuid(options.userId)), {
|
|
78
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
81
79
|
path: ['userId']
|
|
82
|
-
})
|
|
83
|
-
.refine(options => options.scope !== 'user' || (!options.userId && !options.userName) || options.userId || (options.userName && validation.isValidUserPrincipalName(options.userName)),
|
|
84
|
-
|
|
80
|
+
})
|
|
81
|
+
.refine(options => options.scope !== 'user' || (!options.userId && !options.userName) || options.userId || (options.userName && validation.isValidUserPrincipalName(options.userName)), {
|
|
82
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
85
83
|
path: ['userName']
|
|
86
|
-
})
|
|
84
|
+
})
|
|
87
85
|
.refine(options => options.scope !== 'group' || Object.values([options.userId, options.userName, options.administrativeUnitId, options.administrativeUnitName, options.customAppScopeId, options.customAppScopeName]).filter(v => typeof v !== 'undefined').length === 0, {
|
|
88
86
|
message: "When the scope is set to 'group' then do not specify userId, userName, administrativeUnitId, administrativeUnitName, customAppScopeId nor customAppScopeName",
|
|
89
87
|
path: ['scope']
|
|
@@ -96,10 +94,10 @@ class ExoAppRoleAssignmentAddCommand extends GraphCommand {
|
|
|
96
94
|
message: "When the scope is set to 'group' specify either groupId or groupName",
|
|
97
95
|
path: ['scope']
|
|
98
96
|
})
|
|
99
|
-
.refine(options => options.scope !== 'group' || (!options.groupId && !options.groupName) || options.groupName || (options.groupId && validation.isValidGuid(options.groupId)),
|
|
100
|
-
|
|
97
|
+
.refine(options => options.scope !== 'group' || (!options.groupId && !options.groupName) || options.groupName || (options.groupId && validation.isValidGuid(options.groupId)), {
|
|
98
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
101
99
|
path: ['groupId']
|
|
102
|
-
})
|
|
100
|
+
})
|
|
103
101
|
.refine(options => options.scope !== 'administrativeUnit' || Object.values([options.userId, options.userName, options.groupId, options.groupName, options.customAppScopeId, options.customAppScopeName]).filter(v => typeof v !== 'undefined').length === 0, {
|
|
104
102
|
message: "When the scope is set to 'administrativeUnit' then do not specify userId, userName, groupId, groupName, customAppScopeId nor customAppScopeName",
|
|
105
103
|
path: ['scope']
|
|
@@ -112,10 +110,10 @@ class ExoAppRoleAssignmentAddCommand extends GraphCommand {
|
|
|
112
110
|
message: "When the scope is set to 'administrativeUnit' specify either administrativeUnitId or administrativeUnitName",
|
|
113
111
|
path: ['scope']
|
|
114
112
|
})
|
|
115
|
-
.refine(options => options.scope !== 'administrativeUnit' || (!options.administrativeUnitId && !options.administrativeUnitName) || options.administrativeUnitName || (options.administrativeUnitId && validation.isValidGuid(options.administrativeUnitId)),
|
|
116
|
-
|
|
113
|
+
.refine(options => options.scope !== 'administrativeUnit' || (!options.administrativeUnitId && !options.administrativeUnitName) || options.administrativeUnitName || (options.administrativeUnitId && validation.isValidGuid(options.administrativeUnitId)), {
|
|
114
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
117
115
|
path: ['administrativeUnitId']
|
|
118
|
-
})
|
|
116
|
+
})
|
|
119
117
|
.refine(options => options.scope !== 'custom' || Object.values([options.userId, options.userName, options.groupId, options.groupName, options.administrativeUnitId, options.administrativeUnitName]).filter(v => typeof v !== 'undefined').length === 0, {
|
|
120
118
|
message: "When the scope is set to 'custom' then do not specify userId, userName, groupId, groupName, administrativeUnitId nor administrativeUnitName",
|
|
121
119
|
path: ['scope']
|
|
@@ -128,10 +126,10 @@ class ExoAppRoleAssignmentAddCommand extends GraphCommand {
|
|
|
128
126
|
message: "When the scope is set to 'custom' specify either customAppScopeId or customAppScopeName",
|
|
129
127
|
path: ['scope']
|
|
130
128
|
})
|
|
131
|
-
.refine(options => options.scope !== 'custom' || (!options.customAppScopeId && !options.customAppScopeName) || options.customAppScopeName || (options.customAppScopeId && validation.isValidGuid(options.customAppScopeId)),
|
|
132
|
-
|
|
129
|
+
.refine(options => options.scope !== 'custom' || (!options.customAppScopeId && !options.customAppScopeName) || options.customAppScopeName || (options.customAppScopeId && validation.isValidGuid(options.customAppScopeId)), {
|
|
130
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
133
131
|
path: ['customAppScopeId']
|
|
134
|
-
})
|
|
132
|
+
});
|
|
135
133
|
}
|
|
136
134
|
async commandAction(logger, args) {
|
|
137
135
|
try {
|
|
@@ -2,15 +2,13 @@ import { z } from 'zod';
|
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
3
|
import request from '../../../../request.js';
|
|
4
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
5
|
-
import { zod } from '../../../../utils/zod.js';
|
|
6
5
|
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
7
6
|
import commands from '../../commands.js';
|
|
8
|
-
const options =
|
|
9
|
-
.
|
|
10
|
-
name:
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
name: z.string().optional().alias('n'),
|
|
11
10
|
default: z.boolean().optional()
|
|
12
|
-
})
|
|
13
|
-
.strict();
|
|
11
|
+
});
|
|
14
12
|
class FlowEnvironmentGetCommand extends PowerAutomateCommand {
|
|
15
13
|
get name() {
|
|
16
14
|
return commands.ENVIRONMENT_GET;
|
|
@@ -24,7 +22,7 @@ class FlowEnvironmentGetCommand extends PowerAutomateCommand {
|
|
|
24
22
|
getRefinedSchema(schema) {
|
|
25
23
|
return schema
|
|
26
24
|
.refine(options => !!options.name !== !!options.default, {
|
|
27
|
-
|
|
25
|
+
error: `Specify either name or default, but not both.`
|
|
28
26
|
});
|
|
29
27
|
}
|
|
30
28
|
async commandAction(logger, args) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { odata } from '../../../../utils/odata.js';
|
|
2
2
|
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
|
+
import { z } from 'zod';
|
|
4
5
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
5
|
-
const options = globalOptionsZod.
|
|
6
|
+
export const options = z.strictObject({ ...globalOptionsZod.shape });
|
|
6
7
|
class FlowEnvironmentListCommand extends PowerAutomateCommand {
|
|
7
8
|
get name() {
|
|
8
9
|
return commands.ENVIRONMENT_LIST;
|