@pnp/cli-microsoft365 11.4.0-beta.13d597c → 11.4.0-beta.312ca0b
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Command.js +2 -2
- package/dist/cli/cli.js +8 -8
- 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 +17 -18
- 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/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/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.js +4 -6
- 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/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-publish.js +9 -10
- package/dist/m365/spo/commands/page/page-section-remove.js +11 -12
- 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/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 +29 -0
- 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/list/list-defaultvalue-get.mdx +118 -0
- package/npm-shrinkwrap.json +4 -11
- package/package.json +2 -2
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { zod } from '../../../../utils/zod.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
|
-
import { validation } from '../../../../utils/validation.js';
|
|
7
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
6
|
import request from '../../../../request.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
11
|
-
environmentName:
|
|
12
|
-
flowName:
|
|
13
|
-
|
|
14
|
-
message: `'${name}' is not a valid GUID.`
|
|
15
|
-
})))
|
|
16
|
-
})
|
|
17
|
-
.strict();
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
environmentName: z.string().alias('e'),
|
|
10
|
+
flowName: z.uuid().alias('n')
|
|
11
|
+
});
|
|
18
12
|
class FlowRecycleBinItemRestoreCommand extends PowerAutomateCommand {
|
|
19
13
|
get name() {
|
|
20
14
|
return commands.RECYCLEBINITEM_RESTORE;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
3
|
import request from '../../../../request.js';
|
|
4
|
-
import { zod } from '../../../../utils/zod.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
7
6
|
import { validation } from '../../../../utils/validation.js';
|
|
8
7
|
import { entraApp } from '../../../../utils/entraApp.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
11
|
-
name:
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
name: z.string().alias('n'),
|
|
12
11
|
appId: z.string().optional(),
|
|
13
12
|
appObjectId: z.string().optional(),
|
|
14
13
|
appName: z.string().optional(),
|
|
@@ -16,8 +15,7 @@ const options = globalOptionsZod
|
|
|
16
15
|
targetObjects: z.string().transform((value) => value.split(',').map(String))
|
|
17
16
|
.pipe(z.enum(['User', 'Group', 'Application', 'AdministrativeUnit', 'Device', 'Organization']).array()),
|
|
18
17
|
isMultiValued: z.boolean().optional()
|
|
19
|
-
})
|
|
20
|
-
.strict();
|
|
18
|
+
});
|
|
21
19
|
class GraphDirectoryExtensionAddCommand extends GraphCommand {
|
|
22
20
|
get name() {
|
|
23
21
|
return commands.DIRECTORYEXTENSION_ADD;
|
|
@@ -31,18 +29,18 @@ class GraphDirectoryExtensionAddCommand extends GraphCommand {
|
|
|
31
29
|
getRefinedSchema(schema) {
|
|
32
30
|
return schema
|
|
33
31
|
.refine(options => Object.values([options.appId, options.appObjectId, options.appName]).filter(v => typeof v !== 'undefined').length === 1, {
|
|
34
|
-
|
|
32
|
+
error: 'Specify either appId, appObjectId or appName, but not multiple'
|
|
35
33
|
})
|
|
36
34
|
.refine(options => (!options.appId && !options.appObjectId && !options.appName) || options.appObjectId || options.appName ||
|
|
37
|
-
(options.appId && validation.isValidGuid(options.appId)),
|
|
38
|
-
|
|
35
|
+
(options.appId && validation.isValidGuid(options.appId)), {
|
|
36
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
39
37
|
path: ['appId']
|
|
40
|
-
})
|
|
38
|
+
})
|
|
41
39
|
.refine(options => (!options.appId && !options.appObjectId && !options.appName) || options.appId || options.appName ||
|
|
42
|
-
(options.appObjectId && validation.isValidGuid(options.appObjectId)),
|
|
43
|
-
|
|
40
|
+
(options.appObjectId && validation.isValidGuid(options.appObjectId)), {
|
|
41
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
44
42
|
path: ['appObjectId']
|
|
45
|
-
})
|
|
43
|
+
});
|
|
46
44
|
}
|
|
47
45
|
async commandAction(logger, args) {
|
|
48
46
|
try {
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
3
|
import request from '../../../../request.js';
|
|
4
|
-
import { zod } from '../../../../utils/zod.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
7
|
-
import { validation } from '../../../../utils/validation.js';
|
|
8
6
|
import { entraApp } from '../../../../utils/entraApp.js';
|
|
9
7
|
import { directoryExtension } from '../../../../utils/directoryExtension.js';
|
|
10
|
-
const options =
|
|
11
|
-
.
|
|
12
|
-
id:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
appId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
17
|
-
message: `'${id}' is not a valid GUID.`
|
|
18
|
-
})).optional(),
|
|
19
|
-
appObjectId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
20
|
-
message: `'${id}' is not a valid GUID.`
|
|
21
|
-
})).optional(),
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
id: z.uuid().optional().alias('i'),
|
|
11
|
+
name: z.string().optional().alias('n'),
|
|
12
|
+
appId: z.uuid().optional(),
|
|
13
|
+
appObjectId: z.uuid().optional(),
|
|
22
14
|
appName: z.string().optional()
|
|
23
|
-
})
|
|
24
|
-
.strict();
|
|
15
|
+
});
|
|
25
16
|
class GraphDirectoryExtensionGetCommand extends GraphCommand {
|
|
26
17
|
get name() {
|
|
27
18
|
return commands.DIRECTORYEXTENSION_GET;
|
|
@@ -35,13 +26,13 @@ class GraphDirectoryExtensionGetCommand extends GraphCommand {
|
|
|
35
26
|
getRefinedSchema(schema) {
|
|
36
27
|
return schema
|
|
37
28
|
.refine(options => !options.id !== !options.name, {
|
|
38
|
-
|
|
29
|
+
error: 'Specify either id or name, but not both'
|
|
39
30
|
})
|
|
40
31
|
.refine(options => options.id || options.name, {
|
|
41
|
-
|
|
32
|
+
error: 'Specify either id or name'
|
|
42
33
|
})
|
|
43
34
|
.refine(options => Object.values([options.appId, options.appObjectId, options.appName]).filter(v => typeof v !== 'undefined').length === 1, {
|
|
44
|
-
|
|
35
|
+
error: 'Specify either appId, appObjectId or appName, but not multiple'
|
|
45
36
|
});
|
|
46
37
|
}
|
|
47
38
|
async commandAction(logger, args) {
|
|
@@ -3,20 +3,14 @@ import { globalOptionsZod } from '../../../../Command.js';
|
|
|
3
3
|
import request from '../../../../request.js';
|
|
4
4
|
import commands from '../../commands.js';
|
|
5
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
6
|
-
import { validation } from '../../../../utils/validation.js';
|
|
7
6
|
import { entraApp } from '../../../../utils/entraApp.js';
|
|
8
7
|
import { odata } from '../../../../utils/odata.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
11
|
-
appId: z.
|
|
12
|
-
|
|
13
|
-
})).optional(),
|
|
14
|
-
appObjectId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
15
|
-
message: `'${id}' is not a valid GUID.`
|
|
16
|
-
})).optional(),
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
appId: z.uuid().optional(),
|
|
11
|
+
appObjectId: z.uuid().optional(),
|
|
17
12
|
appName: z.string().optional()
|
|
18
|
-
})
|
|
19
|
-
.strict();
|
|
13
|
+
});
|
|
20
14
|
class GraphDirectoryExtensionListCommand extends GraphCommand {
|
|
21
15
|
get name() {
|
|
22
16
|
return commands.DIRECTORYEXTENSION_LIST;
|
|
@@ -33,7 +27,7 @@ class GraphDirectoryExtensionListCommand extends GraphCommand {
|
|
|
33
27
|
getRefinedSchema(schema) {
|
|
34
28
|
return schema
|
|
35
29
|
.refine(options => ([options.appId, options.appObjectId, options.appName].filter(x => x !== undefined).length <= 1), {
|
|
36
|
-
|
|
30
|
+
error: 'Specify either appId, appObjectId, or appName, but not multiple.'
|
|
37
31
|
});
|
|
38
32
|
}
|
|
39
33
|
async commandAction(logger, args) {
|
|
@@ -1,29 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
3
|
import request from '../../../../request.js';
|
|
4
|
-
import { zod } from '../../../../utils/zod.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
7
|
-
import { validation } from '../../../../utils/validation.js';
|
|
8
6
|
import { entraApp } from '../../../../utils/entraApp.js';
|
|
9
7
|
import { cli } from '../../../../cli/cli.js';
|
|
10
8
|
import { directoryExtension } from '../../../../utils/directoryExtension.js';
|
|
11
|
-
const options =
|
|
12
|
-
.
|
|
13
|
-
id:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
appId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
18
|
-
message: `'${id}' is not a valid GUID.`
|
|
19
|
-
})).optional(),
|
|
20
|
-
appObjectId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
21
|
-
message: `'${id}' is not a valid GUID.`
|
|
22
|
-
})).optional(),
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
id: z.uuid().optional().alias('i'),
|
|
12
|
+
name: z.string().optional().alias('n'),
|
|
13
|
+
appId: z.uuid().optional(),
|
|
14
|
+
appObjectId: z.uuid().optional(),
|
|
23
15
|
appName: z.string().optional(),
|
|
24
|
-
force:
|
|
25
|
-
})
|
|
26
|
-
.strict();
|
|
16
|
+
force: z.boolean().optional().alias('f')
|
|
17
|
+
});
|
|
27
18
|
class GraphDirectoryExtensionRemoveCommand extends GraphCommand {
|
|
28
19
|
get name() {
|
|
29
20
|
return commands.DIRECTORYEXTENSION_REMOVE;
|
|
@@ -37,13 +28,13 @@ class GraphDirectoryExtensionRemoveCommand extends GraphCommand {
|
|
|
37
28
|
getRefinedSchema(schema) {
|
|
38
29
|
return schema
|
|
39
30
|
.refine(options => !options.id !== !options.name, {
|
|
40
|
-
|
|
31
|
+
error: 'Specify either id or name, but not both'
|
|
41
32
|
})
|
|
42
33
|
.refine(options => options.id || options.name, {
|
|
43
|
-
|
|
34
|
+
error: 'Specify either id or name'
|
|
44
35
|
})
|
|
45
36
|
.refine(options => Object.values([options.appId, options.appObjectId, options.appName]).filter(v => typeof v !== 'undefined').length === 1, {
|
|
46
|
-
|
|
37
|
+
error: 'Specify either appId, appObjectId or appName, but not multiple'
|
|
47
38
|
});
|
|
48
39
|
}
|
|
49
40
|
async commandAction(logger, args) {
|
|
@@ -6,13 +6,12 @@ import GraphCommand from '../../../base/GraphCommand.js';
|
|
|
6
6
|
import commands from '../../commands.js';
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { optionsUtils } from '../../../../utils/optionsUtils.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
11
|
-
name:
|
|
12
|
-
resourceId:
|
|
13
|
-
resourceType:
|
|
14
|
-
})
|
|
15
|
-
.passthrough();
|
|
9
|
+
const options = z.looseObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
name: z.string().alias('n'),
|
|
12
|
+
resourceId: z.string().alias('i'),
|
|
13
|
+
resourceType: z.enum(['user', 'group', 'device', 'organization']).alias('t')
|
|
14
|
+
});
|
|
16
15
|
class GraphOpenExtensionAddCommand extends GraphCommand {
|
|
17
16
|
get name() {
|
|
18
17
|
return commands.OPENEXTENSION_ADD;
|
|
@@ -25,14 +24,14 @@ class GraphOpenExtensionAddCommand extends GraphCommand {
|
|
|
25
24
|
}
|
|
26
25
|
getRefinedSchema(schema) {
|
|
27
26
|
return schema
|
|
28
|
-
.refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' || (options.resourceId && validation.isValidGuid(options.resourceId)),
|
|
29
|
-
|
|
27
|
+
.refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' || (options.resourceId && validation.isValidGuid(options.resourceId)), {
|
|
28
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
30
29
|
path: ['resourceId']
|
|
31
|
-
})
|
|
32
|
-
.refine(options => options.resourceType !== 'user' || (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))),
|
|
33
|
-
|
|
30
|
+
})
|
|
31
|
+
.refine(options => options.resourceType !== 'user' || (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))), {
|
|
32
|
+
error: e => `The '${e.input}' must be a valid GUID or user principal name`,
|
|
34
33
|
path: ['resourceId']
|
|
35
|
-
})
|
|
34
|
+
});
|
|
36
35
|
}
|
|
37
36
|
async commandAction(logger, args) {
|
|
38
37
|
try {
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import { validation } from '../../../../utils/validation.js';
|
|
5
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
6
5
|
import commands from '../../commands.js';
|
|
7
6
|
import request from '../../../../request.js';
|
|
8
|
-
const options =
|
|
9
|
-
.
|
|
10
|
-
resourceId:
|
|
11
|
-
resourceType:
|
|
12
|
-
name:
|
|
13
|
-
})
|
|
14
|
-
.strict();
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
resourceId: z.string().alias('i'),
|
|
10
|
+
resourceType: z.enum(['user', 'group', 'device', 'organization']).alias('t'),
|
|
11
|
+
name: z.string().alias('n')
|
|
12
|
+
});
|
|
15
13
|
class GraphOpenExtensionGetCommand extends GraphCommand {
|
|
16
14
|
get name() {
|
|
17
15
|
return commands.OPENEXTENSION_GET;
|
|
@@ -24,14 +22,14 @@ class GraphOpenExtensionGetCommand extends GraphCommand {
|
|
|
24
22
|
}
|
|
25
23
|
getRefinedSchema(schema) {
|
|
26
24
|
return schema
|
|
27
|
-
.refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' || (options.resourceId && validation.isValidGuid(options.resourceId)),
|
|
28
|
-
|
|
25
|
+
.refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' || (options.resourceId && validation.isValidGuid(options.resourceId)), {
|
|
26
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
29
27
|
path: ['resourceId']
|
|
30
|
-
})
|
|
31
|
-
.refine(options => options.resourceType !== 'user' || (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))),
|
|
32
|
-
|
|
28
|
+
})
|
|
29
|
+
.refine(options => options.resourceType !== 'user' || (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))), {
|
|
30
|
+
error: e => `The '${e.input}' must be a valid GUID or user principal name`,
|
|
33
31
|
path: ['resourceId']
|
|
34
|
-
})
|
|
32
|
+
});
|
|
35
33
|
}
|
|
36
34
|
async commandAction(logger, args) {
|
|
37
35
|
try {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import { validation } from '../../../../utils/validation.js';
|
|
5
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
6
5
|
import commands from '../../commands.js';
|
|
7
6
|
import { odata } from '../../../../utils/odata.js';
|
|
8
|
-
const options =
|
|
9
|
-
.
|
|
10
|
-
resourceId:
|
|
11
|
-
resourceType:
|
|
12
|
-
})
|
|
13
|
-
.strict();
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
resourceId: z.string().alias('i'),
|
|
10
|
+
resourceType: z.enum(['user', 'group', 'device', 'organization']).alias('t')
|
|
11
|
+
});
|
|
14
12
|
class GraphOpenExtensionListCommand extends GraphCommand {
|
|
15
13
|
get name() {
|
|
16
14
|
return commands.OPENEXTENSION_LIST;
|
|
@@ -27,15 +25,15 @@ class GraphOpenExtensionListCommand extends GraphCommand {
|
|
|
27
25
|
getRefinedSchema(schema) {
|
|
28
26
|
return schema
|
|
29
27
|
.refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' ||
|
|
30
|
-
(options.resourceId && validation.isValidGuid(options.resourceId)),
|
|
31
|
-
|
|
28
|
+
(options.resourceId && validation.isValidGuid(options.resourceId)), {
|
|
29
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
32
30
|
path: ['resourceId']
|
|
33
|
-
})
|
|
31
|
+
})
|
|
34
32
|
.refine(options => options.resourceType !== 'user' ||
|
|
35
|
-
(options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))),
|
|
36
|
-
|
|
33
|
+
(options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))), {
|
|
34
|
+
error: e => `The '${e.input}' must be a valid GUID or user principal name`,
|
|
37
35
|
path: ['resourceId']
|
|
38
|
-
})
|
|
36
|
+
});
|
|
39
37
|
}
|
|
40
38
|
async commandAction(logger, args) {
|
|
41
39
|
try {
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import { validation } from '../../../../utils/validation.js';
|
|
5
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
6
5
|
import commands from '../../commands.js';
|
|
7
6
|
import { cli } from '../../../../cli/cli.js';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
11
|
-
resourceId:
|
|
12
|
-
resourceType:
|
|
13
|
-
name:
|
|
14
|
-
force:
|
|
15
|
-
})
|
|
16
|
-
.strict();
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
resourceId: z.string().alias('i'),
|
|
11
|
+
resourceType: z.enum(['user', 'group', 'device', 'organization']).alias('t'),
|
|
12
|
+
name: z.string().alias('n'),
|
|
13
|
+
force: z.boolean().optional().alias('f')
|
|
14
|
+
});
|
|
17
15
|
class GraphOpenExtensionRemoveCommand extends GraphCommand {
|
|
18
16
|
get name() {
|
|
19
17
|
return commands.OPENEXTENSION_REMOVE;
|
|
@@ -26,14 +24,14 @@ class GraphOpenExtensionRemoveCommand extends GraphCommand {
|
|
|
26
24
|
}
|
|
27
25
|
getRefinedSchema(schema) {
|
|
28
26
|
return schema
|
|
29
|
-
.refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' || (options.resourceId && validation.isValidGuid(options.resourceId)),
|
|
30
|
-
|
|
27
|
+
.refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' || (options.resourceId && validation.isValidGuid(options.resourceId)), {
|
|
28
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
31
29
|
path: ['resourceId']
|
|
32
|
-
})
|
|
33
|
-
.refine(options => options.resourceType !== 'user' || (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))),
|
|
34
|
-
|
|
30
|
+
})
|
|
31
|
+
.refine(options => options.resourceType !== 'user' || (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))), {
|
|
32
|
+
error: e => `The '${e.input}' must be a valid GUID or user principal name`,
|
|
35
33
|
path: ['resourceId']
|
|
36
|
-
})
|
|
34
|
+
});
|
|
37
35
|
}
|
|
38
36
|
async commandAction(logger, args) {
|
|
39
37
|
const removeOpenExtension = async () => {
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
-
import
|
|
3
|
+
import request from '../../../../request.js';
|
|
4
|
+
import { optionsUtils } from '../../../../utils/optionsUtils.js';
|
|
4
5
|
import { validation } from '../../../../utils/validation.js';
|
|
6
|
+
import { zod } from '../../../../utils/zod.js';
|
|
5
7
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
6
8
|
import commands from '../../commands.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
keepUnchangedProperties: zod.alias('k', z.boolean().optional())
|
|
15
|
-
})
|
|
16
|
-
.passthrough();
|
|
9
|
+
const options = z.looseObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
name: z.string().alias('n'),
|
|
12
|
+
resourceId: z.string().alias('i'),
|
|
13
|
+
resourceType: z.enum(['user', 'group', 'device', 'organization']).alias('t'),
|
|
14
|
+
keepUnchangedProperties: z.boolean().optional().alias('k')
|
|
15
|
+
});
|
|
17
16
|
class GraphOpenExtensionSetCommand extends GraphCommand {
|
|
18
17
|
constructor() {
|
|
19
18
|
super(...arguments);
|
|
@@ -30,14 +29,14 @@ class GraphOpenExtensionSetCommand extends GraphCommand {
|
|
|
30
29
|
}
|
|
31
30
|
getRefinedSchema(schema) {
|
|
32
31
|
return schema
|
|
33
|
-
.refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' || (options.resourceId && validation.isValidGuid(options.resourceId)),
|
|
34
|
-
|
|
32
|
+
.refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' || (options.resourceId && validation.isValidGuid(options.resourceId)), {
|
|
33
|
+
error: e => `The '${e.input}' must be a valid GUID`,
|
|
35
34
|
path: ['resourceId']
|
|
36
|
-
})
|
|
37
|
-
.refine(options => options.resourceType !== 'user' || (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))),
|
|
38
|
-
|
|
35
|
+
})
|
|
36
|
+
.refine(options => options.resourceType !== 'user' || (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))), {
|
|
37
|
+
error: e => `The '${e.input}' must be a valid GUID or user principal name`,
|
|
39
38
|
path: ['resourceId']
|
|
40
|
-
})
|
|
39
|
+
});
|
|
41
40
|
}
|
|
42
41
|
async commandAction(logger, args) {
|
|
43
42
|
try {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { globalOptionsZod } from '../../../Command.js';
|
|
2
3
|
import config from "../../../config.js";
|
|
3
4
|
import request from "../../../request.js";
|
|
4
5
|
import { spo } from "../../../utils/spo.js";
|
|
5
6
|
import SpoCommand from "../../base/SpoCommand.js";
|
|
6
7
|
import commands from "../commands.js";
|
|
7
|
-
const options = globalOptionsZod.
|
|
8
|
+
export const options = z.strictObject({ ...globalOptionsZod.shape });
|
|
8
9
|
class OneDriveListCommand extends SpoCommand {
|
|
9
10
|
get name() {
|
|
10
11
|
return commands.LIST;
|
|
@@ -3,26 +3,21 @@ 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
|
-
import { zod } from '../../../../utils/zod.js';
|
|
7
6
|
import { validation } from '../../../../utils/validation.js';
|
|
8
7
|
import { accessToken } from '../../../../utils/accessToken.js';
|
|
9
8
|
import auth from '../../../../Auth.js';
|
|
10
|
-
const options =
|
|
11
|
-
.
|
|
12
|
-
userId:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.refine(userName => validation.isValidUserPrincipalName(userName), userName => ({
|
|
18
|
-
message: `'${userName}' is not a valid UPN.`
|
|
19
|
-
})).optional()),
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
userId: z.uuid().optional().alias('i'),
|
|
12
|
+
userName: z.string()
|
|
13
|
+
.refine(userName => validation.isValidUserPrincipalName(userName), {
|
|
14
|
+
error: e => `'${e.input}' is not a valid UPN.`
|
|
15
|
+
}).optional().alias('n'),
|
|
20
16
|
folderName: z.string(),
|
|
21
17
|
messageFilter: z.string(),
|
|
22
18
|
sourceFoldersIds: z.string().transform((value) => value.split(',')).pipe(z.string().array()),
|
|
23
19
|
includeNestedFolders: z.boolean().optional()
|
|
24
|
-
})
|
|
25
|
-
.strict();
|
|
20
|
+
});
|
|
26
21
|
class OutlookMailSearchFolderAddCommand extends GraphCommand {
|
|
27
22
|
get name() {
|
|
28
23
|
return commands.MAIL_SEARCHFOLDER_ADD;
|
|
@@ -36,7 +31,7 @@ class OutlookMailSearchFolderAddCommand extends GraphCommand {
|
|
|
36
31
|
getRefinedSchema(schema) {
|
|
37
32
|
return schema
|
|
38
33
|
.refine(options => !(options.userId && options.userName), {
|
|
39
|
-
|
|
34
|
+
error: 'Specify either userId or userName, but not both'
|
|
40
35
|
});
|
|
41
36
|
}
|
|
42
37
|
async commandAction(logger, args) {
|
|
@@ -1,22 +1,18 @@
|
|
|
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 { accessToken } from '../../../../utils/accessToken.js';
|
|
9
8
|
import auth from '../../../../Auth.js';
|
|
10
|
-
const options =
|
|
11
|
-
.
|
|
12
|
-
userId:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})).optional())
|
|
18
|
-
})
|
|
19
|
-
.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
|
+
});
|
|
20
16
|
class OutlookMailboxSettingsGetCommand extends GraphCommand {
|
|
21
17
|
get name() {
|
|
22
18
|
return commands.MAILBOX_SETTINGS_GET;
|
|
@@ -30,7 +26,7 @@ class OutlookMailboxSettingsGetCommand extends GraphCommand {
|
|
|
30
26
|
getRefinedSchema(schema) {
|
|
31
27
|
return schema
|
|
32
28
|
.refine(options => !(options.userId && options.userName), {
|
|
33
|
-
|
|
29
|
+
error: 'Specify either userId or userName, but not both'
|
|
34
30
|
});
|
|
35
31
|
}
|
|
36
32
|
async commandAction(logger, args) {
|
|
@@ -1,20 +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 { accessToken } from '../../../../utils/accessToken.js';
|
|
9
8
|
import auth from '../../../../Auth.js';
|
|
10
|
-
const options =
|
|
11
|
-
.
|
|
12
|
-
userId:
|
|
13
|
-
|
|
14
|
-
})
|
|
15
|
-
userName:
|
|
16
|
-
|
|
17
|
-
})
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
userId: z.string().refine(id => validation.isValidGuid(id), {
|
|
12
|
+
error: e => `'${e.input}' is not a valid GUID.`
|
|
13
|
+
}).optional().alias('i'),
|
|
14
|
+
userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
15
|
+
error: e => `'${e.input}' is not a valid UPN.`
|
|
16
|
+
}).optional().alias('n'),
|
|
18
17
|
dateFormat: z.string().optional(),
|
|
19
18
|
timeFormat: z.string().optional(),
|
|
20
19
|
timeZone: z.string().optional(),
|
|
@@ -32,8 +31,7 @@ const options = globalOptionsZod
|
|
|
32
31
|
autoReplyEndDateTime: z.string().optional(),
|
|
33
32
|
autoReplyEndTimeZone: z.string().optional(),
|
|
34
33
|
autoReplyStatus: z.enum(['disabled', 'scheduled', 'alwaysEnabled']).optional()
|
|
35
|
-
})
|
|
36
|
-
.strict();
|
|
34
|
+
});
|
|
37
35
|
class OutlookMailboxSettingsSetCommand extends GraphCommand {
|
|
38
36
|
get name() {
|
|
39
37
|
return commands.MAILBOX_SETTINGS_SET;
|
|
@@ -47,13 +45,15 @@ class OutlookMailboxSettingsSetCommand extends GraphCommand {
|
|
|
47
45
|
getRefinedSchema(schema) {
|
|
48
46
|
return schema
|
|
49
47
|
.refine(options => !(options.userId && options.userName), {
|
|
50
|
-
|
|
48
|
+
error: 'Specify either userId or userName, but not both'
|
|
51
49
|
})
|
|
52
|
-
.refine(options => [
|
|
50
|
+
.refine(options => [
|
|
51
|
+
options.workingDays, options.workingHoursStartTime, options.workingHoursEndTime, options.workingHoursTimeZone,
|
|
53
52
|
options.autoReplyStatus, options.autoReplyExternalAudience, options.autoReplyExternalMessage, options.autoReplyInternalMessage,
|
|
54
53
|
options.autoReplyStartDateTime, options.autoReplyStartTimeZone, options.autoReplyEndDateTime, options.autoReplyEndTimeZone,
|
|
55
|
-
options.timeFormat, options.timeZone, options.dateFormat, options.delegateMeetingMessageDeliveryOptions, options.language
|
|
56
|
-
|
|
54
|
+
options.timeFormat, options.timeZone, options.dateFormat, options.delegateMeetingMessageDeliveryOptions, options.language
|
|
55
|
+
].filter(o => o !== undefined).length > 0, {
|
|
56
|
+
error: 'Specify at least one of the following options: workingDays, workingHoursStartTime, workingHoursEndTime, workingHoursTimeZone, autoReplyStatus, autoReplyExternalAudience, autoReplyExternalMessage, autoReplyInternalMessage, autoReplyStartDateTime, autoReplyStartTimeZone, autoReplyEndDateTime, autoReplyEndTimeZone, timeFormat, timeZone, dateFormat, delegateMeetingMessageDeliveryOptions, or language'
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
async commandAction(logger, args) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
3
|
import { odata } from '../../../../utils/odata.js';
|
|
3
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
4
5
|
import commands from '../../commands.js';
|
|
5
|
-
const options = globalOptionsZod.
|
|
6
|
+
export const options = z.strictObject({ ...globalOptionsZod.shape });
|
|
6
7
|
class OutlookRoomListListCommand extends GraphCommand {
|
|
7
8
|
get name() {
|
|
8
9
|
return commands.ROOMLIST_LIST;
|