@pnp/cli-microsoft365 11.4.0-beta.0b6d893 → 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
|
@@ -3,27 +3,23 @@ import { z } from 'zod';
|
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
4
|
import { validation } from '../../../../utils/validation.js';
|
|
5
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
6
|
-
import { zod } from '../../../../utils/zod.js';
|
|
7
6
|
import { cli } from '../../../../cli/cli.js';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
9
|
import { Page } from './Page.js';
|
|
11
10
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
12
|
-
const options =
|
|
13
|
-
.
|
|
14
|
-
webUrl:
|
|
15
|
-
.refine(url => validation.isValidSharePointUrl(url) === true,
|
|
16
|
-
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
message: `'${id}' is not a valid GUID.`
|
|
22
|
-
})),
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
webUrl: z.string()
|
|
14
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
15
|
+
error: e => `'${e.input}' is not a valid SharePoint URL.`
|
|
16
|
+
})
|
|
17
|
+
.alias('u'),
|
|
18
|
+
pageName: z.string().alias('n'),
|
|
19
|
+
id: z.uuid().alias('i'),
|
|
23
20
|
draft: z.boolean().optional(),
|
|
24
|
-
force:
|
|
25
|
-
})
|
|
26
|
-
.strict();
|
|
21
|
+
force: z.boolean().optional().alias('f')
|
|
22
|
+
});
|
|
27
23
|
class SpoPageControlRemoveCommand extends SpoCommand {
|
|
28
24
|
get name() {
|
|
29
25
|
return commands.PAGE_CONTROL_REMOVE;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { zod } from '../../../../utils/zod.js';
|
|
3
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
3
|
import request from '../../../../request.js';
|
|
5
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -7,17 +6,17 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
|
7
6
|
import { validation } from '../../../../utils/validation.js';
|
|
8
7
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
9
8
|
import commands from '../../commands.js';
|
|
10
|
-
const options =
|
|
11
|
-
.
|
|
12
|
-
webUrl:
|
|
13
|
-
.refine(url => validation.isValidSharePointUrl(url) === true,
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
webUrl: z.string()
|
|
12
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
14
|
+
})
|
|
15
|
+
.alias('u'),
|
|
16
|
+
name: z.string().optional().alias('n'),
|
|
17
17
|
default: z.boolean().optional(),
|
|
18
18
|
metadataOnly: z.boolean().optional()
|
|
19
|
-
})
|
|
20
|
-
.strict();
|
|
19
|
+
});
|
|
21
20
|
class SpoPageGetCommand extends SpoCommand {
|
|
22
21
|
get name() {
|
|
23
22
|
return commands.PAGE_GET;
|
|
@@ -31,7 +30,7 @@ class SpoPageGetCommand extends SpoCommand {
|
|
|
31
30
|
getRefinedSchema(schema) {
|
|
32
31
|
return schema
|
|
33
32
|
.refine(options => [options.name, options.default].filter(x => x !== undefined).length === 1, {
|
|
34
|
-
|
|
33
|
+
error: `Specify either name or default, but not both.`
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
36
|
async commandAction(logger, args) {
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { zod } from '../../../../utils/zod.js';
|
|
3
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
3
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
5
4
|
import { validation } from '../../../../utils/validation.js';
|
|
6
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
7
6
|
import commands from '../../commands.js';
|
|
8
7
|
import { Page } from './Page.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
11
|
-
webUrl:
|
|
12
|
-
.refine(url => validation.isValidSharePointUrl(url) === true,
|
|
13
|
-
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string()
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
})
|
|
14
|
+
.alias('u'),
|
|
15
|
+
name: z.string().alias('n')
|
|
16
|
+
});
|
|
18
17
|
class SpoPagePublishCommand extends SpoCommand {
|
|
19
18
|
get name() {
|
|
20
19
|
return commands.PAGE_PUBLISH;
|
|
@@ -8,18 +8,17 @@ import commands from '../../commands.js';
|
|
|
8
8
|
import { Page } from './Page.js';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
pageName:
|
|
19
|
-
section:
|
|
20
|
-
force:
|
|
21
|
-
})
|
|
22
|
-
.strict();
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
webUrl: z.string()
|
|
14
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
15
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
16
|
+
})
|
|
17
|
+
.alias('u'),
|
|
18
|
+
pageName: z.string().alias('n'),
|
|
19
|
+
section: z.number().alias('s'),
|
|
20
|
+
force: z.boolean().optional().alias('f')
|
|
21
|
+
});
|
|
23
22
|
class SpoPageSectionRemoveCommand extends SpoCommand {
|
|
24
23
|
get name() {
|
|
25
24
|
return commands.PAGE_SECTION_REMOVE;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import { odata } from '../../../../utils/odata.js';
|
|
5
4
|
import { spo } from '../../../../utils/spo.js';
|
|
6
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
7
6
|
import commands from '../../commands.js';
|
|
8
|
-
const options =
|
|
9
|
-
.
|
|
10
|
-
excludeDeletedSites:
|
|
11
|
-
})
|
|
12
|
-
.strict();
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
excludeDeletedSites: z.boolean().optional()
|
|
10
|
+
});
|
|
13
11
|
class SpoSiteAppCatalogListCommand extends SpoCommand {
|
|
14
12
|
get name() {
|
|
15
13
|
return commands.SITE_APPCATALOG_LIST;
|
|
@@ -2,16 +2,14 @@ import { z } from 'zod';
|
|
|
2
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
3
|
import request from '../../../../request.js';
|
|
4
4
|
import { validation } from '../../../../utils/validation.js';
|
|
5
|
-
import { zod } from '../../../../utils/zod.js';
|
|
6
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
7
6
|
import commands from '../../commands.js';
|
|
8
|
-
const options =
|
|
9
|
-
.
|
|
10
|
-
url:
|
|
11
|
-
|
|
12
|
-
}))
|
|
13
|
-
})
|
|
14
|
-
.strict();
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
url: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
10
|
+
error: 'Specify a valid SharePoint site URL'
|
|
11
|
+
}).alias('u')
|
|
12
|
+
});
|
|
15
13
|
class SpoSiteGetCommand extends SpoCommand {
|
|
16
14
|
get name() {
|
|
17
15
|
return commands.SITE_GET;
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import SpoCommand from '../../../base/SpoCommand.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
5
|
import { validation } from '../../../../utils/validation.js';
|
|
7
6
|
import request from '../../../../request.js';
|
|
8
|
-
const options =
|
|
9
|
-
.
|
|
10
|
-
siteUrl:
|
|
11
|
-
.refine(url => validation.isValidSharePointUrl(url) === true,
|
|
12
|
-
|
|
13
|
-
}))
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
siteUrl: z.string()
|
|
10
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
12
|
+
}).alias('u'),
|
|
14
13
|
capability: z.enum(['full', 'limited', 'ownersOnly'])
|
|
15
|
-
})
|
|
16
|
-
.strict();
|
|
14
|
+
});
|
|
17
15
|
class SpoSiteSharingPermissionSetCommand extends SpoCommand {
|
|
18
16
|
get name() {
|
|
19
17
|
return commands.SITE_SHARINGPERMISSION_SET;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import commands from '../../commands.js';
|
|
2
|
-
import SpoCommand from '../../../base/SpoCommand.js';
|
|
3
|
-
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
1
|
import { z } from 'zod';
|
|
5
|
-
import {
|
|
6
|
-
import { validation } from '../../../../utils/validation.js';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
import { validation } from '../../../../utils/validation.js';
|
|
5
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
6
|
+
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
siteUrl: z.string().alias('u')
|
|
10
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
12
|
+
})
|
|
13
|
+
});
|
|
16
14
|
class SpoSiteVersionpolicyGetCommand extends SpoCommand {
|
|
17
15
|
get name() {
|
|
18
16
|
return commands.SITE_VERSIONPOLICY_GET;
|
|
@@ -1,34 +1,27 @@
|
|
|
1
|
-
import commands from '../../commands.js';
|
|
2
|
-
import SpoCommand from '../../../base/SpoCommand.js';
|
|
3
|
-
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
1
|
import { z } from 'zod';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { spo } from '../../../../utils/spo.js';
|
|
2
|
+
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import { entraUser } from '../../../../utils/entraUser.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
6
|
import { odata } from '../../../../utils/odata.js';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
import { spo } from '../../../../utils/spo.js';
|
|
8
|
+
import { validation } from '../../../../utils/validation.js';
|
|
9
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
|
+
import commands from '../../commands.js';
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
webUrl: z.string().alias('u')
|
|
14
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
15
|
+
error: e => `'${e.input}' is not a valid SharePoint site URL.`
|
|
16
|
+
}),
|
|
17
|
+
listId: z.uuid().optional(),
|
|
22
18
|
listUrl: z.string().optional(),
|
|
23
19
|
listTitle: z.string().optional(),
|
|
24
|
-
userName: z.string().refine(upn => validation.isValidUserPrincipalName(upn),
|
|
25
|
-
|
|
26
|
-
})
|
|
27
|
-
userId: z.
|
|
28
|
-
|
|
29
|
-
})).optional()
|
|
30
|
-
})
|
|
31
|
-
.strict();
|
|
20
|
+
userName: z.string().optional().refine(upn => typeof upn === 'undefined' || validation.isValidUserPrincipalName(upn), {
|
|
21
|
+
error: e => `'${e.input}' is not a valid UPN.`
|
|
22
|
+
}),
|
|
23
|
+
userId: z.uuid().optional()
|
|
24
|
+
});
|
|
32
25
|
class SpoWebAlertListCommand extends SpoCommand {
|
|
33
26
|
get name() {
|
|
34
27
|
return commands.WEB_ALERT_LIST;
|
|
@@ -45,10 +38,10 @@ class SpoWebAlertListCommand extends SpoCommand {
|
|
|
45
38
|
getRefinedSchema(schema) {
|
|
46
39
|
return schema
|
|
47
40
|
.refine(options => [options.listId, options.listUrl, options.listTitle].filter(x => x !== undefined).length <= 1, {
|
|
48
|
-
|
|
41
|
+
error: `Specify either listId, listUrl, or listTitle, but not more than one.`
|
|
49
42
|
})
|
|
50
43
|
.refine(options => [options.userName, options.userId].filter(x => x !== undefined).length <= 1, {
|
|
51
|
-
|
|
44
|
+
error: `Specify either userName or userId, but not both.`
|
|
52
45
|
});
|
|
53
46
|
}
|
|
54
47
|
async commandAction(logger, args) {
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import commands from '../../commands.js';
|
|
2
|
-
import SpoCommand from '../../../base/SpoCommand.js';
|
|
3
|
-
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
1
|
import { z } from 'zod';
|
|
5
|
-
import { zod } from '../../../../utils/zod.js';
|
|
6
|
-
import { validation } from '../../../../utils/validation.js';
|
|
7
|
-
import { formatting } from '../../../../utils/formatting.js';
|
|
8
|
-
import request from '../../../../request.js';
|
|
9
2
|
import { cli } from '../../../../cli/cli.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
.
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
|
+
import request from '../../../../request.js';
|
|
5
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
6
|
+
import { validation } from '../../../../utils/validation.js';
|
|
7
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
8
|
+
import commands from '../../commands.js';
|
|
9
|
+
const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
webUrl: z.string().alias('u')
|
|
12
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint URL.`
|
|
14
|
+
}),
|
|
15
|
+
id: z.uuid(),
|
|
16
|
+
force: z.boolean().optional().alias('f')
|
|
17
|
+
});
|
|
23
18
|
class SpoWebAlertRemoveCommand extends SpoCommand {
|
|
24
19
|
get name() {
|
|
25
20
|
return commands.WEB_ALERT_REMOVE;
|
|
@@ -141,6 +141,7 @@ export default {
|
|
|
141
141
|
LIST_CONTENTTYPE_REMOVE: `${prefix} list contenttype remove`,
|
|
142
142
|
LIST_CONTENTTYPE_DEFAULT_SET: `${prefix} list contenttype default set`,
|
|
143
143
|
LIST_DEFAULTVALUE_CLEAR: `${prefix} list defaultvalue clear`,
|
|
144
|
+
LIST_DEFAULTVALUE_GET: `${prefix} list defaultvalue get`,
|
|
144
145
|
LIST_DEFAULTVALUE_LIST: `${prefix} list defaultvalue list`,
|
|
145
146
|
LIST_DEFAULTVALUE_REMOVE: `${prefix} list defaultvalue remove`,
|
|
146
147
|
LIST_DEFAULTVALUE_SET: `${prefix} list defaultvalue set`,
|
|
@@ -7,31 +7,25 @@ import SpoCommand from '../../../base/SpoCommand.js';
|
|
|
7
7
|
import commands from '../../commands.js';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
webUrl:
|
|
18
|
-
.refine(url => validation.isValidSharePointUrl(url) === true,
|
|
19
|
-
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})).optional()),
|
|
25
|
-
title: zod.alias('t', z.string()).optional(),
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
contentCenterUrl: z.string()
|
|
13
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
14
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
15
|
+
})
|
|
16
|
+
.alias('c'),
|
|
17
|
+
webUrl: z.string()
|
|
18
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
19
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
20
|
+
})
|
|
21
|
+
.alias('u'),
|
|
22
|
+
id: z.uuid().optional().alias('i'),
|
|
23
|
+
title: z.string().optional().alias('t'),
|
|
26
24
|
listTitle: z.string().optional(),
|
|
27
|
-
listId: z.
|
|
28
|
-
.refine(listId => validation.isValidGuid(listId) === true, listId => ({
|
|
29
|
-
message: `${listId} is not a valid GUID.`
|
|
30
|
-
})).optional(),
|
|
25
|
+
listId: z.uuid().optional(),
|
|
31
26
|
listUrl: z.string().optional(),
|
|
32
27
|
viewOption: z.enum(['NewViewAsDefault', 'DoNotChangeDefault', 'TileViewAsDefault']).optional()
|
|
33
|
-
})
|
|
34
|
-
.strict();
|
|
28
|
+
});
|
|
35
29
|
class SppModelApplyCommand extends SpoCommand {
|
|
36
30
|
get name() {
|
|
37
31
|
return commands.MODEL_APPLY;
|
|
@@ -45,10 +39,10 @@ class SppModelApplyCommand extends SpoCommand {
|
|
|
45
39
|
getRefinedSchema(schema) {
|
|
46
40
|
return schema
|
|
47
41
|
.refine(options => [options.id, options.title].filter(x => x !== undefined).length === 1, {
|
|
48
|
-
|
|
42
|
+
error: `Specify exactly one of the following options: 'id' or 'title'.`
|
|
49
43
|
})
|
|
50
44
|
.refine(options => [options.listTitle, options.listId, options.listUrl].filter(x => x !== undefined).length === 1, {
|
|
51
|
-
|
|
45
|
+
error: `Specify exactly one of the following options: 'listTitle', 'listId' or 'listUrl'.`
|
|
52
46
|
});
|
|
53
47
|
}
|
|
54
48
|
async commandAction(logger, args) {
|
|
@@ -5,12 +5,9 @@ import GraphApplicationCommand from '../../../base/GraphApplicationCommand.js';
|
|
|
5
5
|
import { validation } from '../../../../utils/validation.js';
|
|
6
6
|
import { entraUser } from '../../../../utils/entraUser.js';
|
|
7
7
|
import { odata } from '../../../../utils/odata.js';
|
|
8
|
-
const options =
|
|
9
|
-
.
|
|
10
|
-
userId: z.
|
|
11
|
-
.refine((val) => validation.isValidGuid(val), {
|
|
12
|
-
message: 'Invalid GUID.'
|
|
13
|
-
}).optional(),
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
userId: z.uuid().optional(),
|
|
14
11
|
userName: z.string()
|
|
15
12
|
.refine((val) => validation.isValidUserPrincipalName(val), {
|
|
16
13
|
message: 'Invalid user principal name.'
|
|
@@ -41,8 +38,7 @@ const options = globalOptionsZod
|
|
|
41
38
|
}, {
|
|
42
39
|
message: 'Date must be a valid ISO date within the last 30 days and not in the future.'
|
|
43
40
|
}).optional()
|
|
44
|
-
})
|
|
45
|
-
.strict();
|
|
41
|
+
});
|
|
46
42
|
class TeamsCallRecordListCommand extends GraphApplicationCommand {
|
|
47
43
|
get name() {
|
|
48
44
|
return commands.CALLRECORD_LIST;
|
|
@@ -59,7 +55,7 @@ class TeamsCallRecordListCommand extends GraphApplicationCommand {
|
|
|
59
55
|
getRefinedSchema(schema) {
|
|
60
56
|
return schema
|
|
61
57
|
.refine((options) => [options.userId, options.userName].filter(o => o !== undefined).length <= 1, {
|
|
62
|
-
|
|
58
|
+
error: 'Use one of the following options: userId or userName but not both.'
|
|
63
59
|
})
|
|
64
60
|
.refine((options) => [options.startDateTime, options.endDateTime].filter(o => o !== undefined).length <= 1 || new Date(options.startDateTime) < new Date(options.endDateTime), {
|
|
65
61
|
message: 'Value of startDateTime, must be before endDateTime.'
|
|
@@ -1,14 +1,12 @@
|
|
|
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 GraphCommand from '../../../base/GraphCommand.js';
|
|
6
5
|
import commands from '../../commands.js';
|
|
7
|
-
const options =
|
|
8
|
-
.
|
|
9
|
-
enabled:
|
|
10
|
-
})
|
|
11
|
-
.strict();
|
|
6
|
+
export const options = z.strictObject({
|
|
7
|
+
...globalOptionsZod.shape,
|
|
8
|
+
enabled: z.boolean().alias('e')
|
|
9
|
+
});
|
|
12
10
|
class TenantPeoplePronounsSetCommand extends GraphCommand {
|
|
13
11
|
get name() {
|
|
14
12
|
return commands.PEOPLE_PRONOUNS_SET;
|
|
@@ -3,12 +3,10 @@ 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
|
-
.strict();
|
|
6
|
+
export const options = z.strictObject({
|
|
7
|
+
...globalOptionsZod.shape,
|
|
8
|
+
displayConcealedNames: z.boolean().alias('d')
|
|
9
|
+
});
|
|
12
10
|
class TenantReportSettingsSetCommand extends GraphCommand {
|
|
13
11
|
get name() {
|
|
14
12
|
return commands.REPORT_SETTINGS_SET;
|
|
@@ -1,6 +1,5 @@
|
|
|
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';
|
|
@@ -8,25 +7,21 @@ import { vivaEngage } from '../../../../utils/vivaEngage.js';
|
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { entraUser } from '../../../../utils/entraUser.js';
|
|
10
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
11
|
-
const options =
|
|
12
|
-
.
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
13
12
|
communityId: z.string().optional(),
|
|
14
|
-
communityDisplayName:
|
|
15
|
-
entraGroupId: z.
|
|
16
|
-
.refine(id => validation.isValidGuid(id), id => ({
|
|
17
|
-
message: `'${id}' is not a valid GUID.`
|
|
18
|
-
})).optional(),
|
|
13
|
+
communityDisplayName: z.string().optional().alias('n'),
|
|
14
|
+
entraGroupId: z.uuid().optional(),
|
|
19
15
|
ids: z.string()
|
|
20
|
-
.refine(ids => validation.isValidGuidArray(ids) === true,
|
|
21
|
-
|
|
22
|
-
})
|
|
16
|
+
.refine(ids => validation.isValidGuidArray(ids) === true, {
|
|
17
|
+
error: e => `The following GUIDs are invalid: ${e.input}.`
|
|
18
|
+
}).optional(),
|
|
23
19
|
userNames: z.string()
|
|
24
|
-
.refine(userNames => validation.isValidUserPrincipalNameArray(userNames) === true,
|
|
25
|
-
|
|
26
|
-
})
|
|
27
|
-
role:
|
|
28
|
-
})
|
|
29
|
-
.strict();
|
|
20
|
+
.refine(userNames => validation.isValidUserPrincipalNameArray(userNames) === true, {
|
|
21
|
+
error: e => `The following user principal names are invalid: ${e.input}.`
|
|
22
|
+
}).optional(),
|
|
23
|
+
role: z.enum(['Admin', 'Member']).alias('r')
|
|
24
|
+
});
|
|
30
25
|
class VivaEngageCommunityUserAddCommand extends GraphCommand {
|
|
31
26
|
get name() {
|
|
32
27
|
return commands.ENGAGE_COMMUNITY_USER_ADD;
|
|
@@ -40,16 +35,16 @@ class VivaEngageCommunityUserAddCommand extends GraphCommand {
|
|
|
40
35
|
getRefinedSchema(schema) {
|
|
41
36
|
return schema
|
|
42
37
|
.refine(options => [options.communityId, options.communityDisplayName, options.entraGroupId].filter(x => x !== undefined).length === 1, {
|
|
43
|
-
|
|
38
|
+
error: 'Specify either communityId, communityDisplayName, or entraGroupId, but not multiple.'
|
|
44
39
|
})
|
|
45
40
|
.refine(options => options.communityId || options.communityDisplayName || options.entraGroupId, {
|
|
46
|
-
|
|
41
|
+
error: 'Specify at least one of communityId, communityDisplayName, or entraGroupId.'
|
|
47
42
|
})
|
|
48
43
|
.refine(options => options.ids || options.userNames, {
|
|
49
|
-
|
|
44
|
+
error: 'Specify either of ids or userNames.'
|
|
50
45
|
})
|
|
51
|
-
.refine(options => options.userNames !== undefined || options.ids !== undefined, {
|
|
52
|
-
|
|
46
|
+
.refine(options => typeof options.userNames !== 'undefined' || typeof options.ids !== 'undefined', {
|
|
47
|
+
error: 'Specify either ids or userNames, but not both.'
|
|
53
48
|
});
|
|
54
49
|
}
|
|
55
50
|
async commandAction(logger, args) {
|
|
@@ -1,22 +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
|
-
import { validation } from '../../../../utils/validation.js';
|
|
7
5
|
import { vivaEngage } from '../../../../utils/vivaEngage.js';
|
|
8
6
|
import { odata } from '../../../../utils/odata.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
11
9
|
communityId: z.string().optional(),
|
|
12
|
-
communityDisplayName:
|
|
13
|
-
entraGroupId: z.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})).optional(),
|
|
17
|
-
role: zod.alias('r', z.enum(['Admin', 'Member']).optional())
|
|
18
|
-
})
|
|
19
|
-
.strict();
|
|
10
|
+
communityDisplayName: z.string().optional().alias('n'),
|
|
11
|
+
entraGroupId: z.uuid().optional(),
|
|
12
|
+
role: z.enum(['Admin', 'Member']).optional().alias('r')
|
|
13
|
+
});
|
|
20
14
|
class VivaEngageCommunityUserListCommand extends GraphCommand {
|
|
21
15
|
get name() {
|
|
22
16
|
return commands.ENGAGE_COMMUNITY_USER_LIST;
|
|
@@ -30,10 +24,10 @@ class VivaEngageCommunityUserListCommand extends GraphCommand {
|
|
|
30
24
|
getRefinedSchema(schema) {
|
|
31
25
|
return schema
|
|
32
26
|
.refine(options => [options.communityId, options.communityDisplayName, options.entraGroupId].filter(x => x !== undefined).length === 1, {
|
|
33
|
-
|
|
27
|
+
error: 'Specify either communityId, communityDisplayName, or entraGroupId, but not multiple.'
|
|
34
28
|
})
|
|
35
29
|
.refine(options => options.communityId || options.communityDisplayName || options.entraGroupId, {
|
|
36
|
-
|
|
30
|
+
error: 'Specify at least one of communityId, communityDisplayName, or entraGroupId.'
|
|
37
31
|
});
|
|
38
32
|
}
|
|
39
33
|
defaultProperties() {
|