@pnp/cli-microsoft365 11.4.0-beta.13d597c → 11.4.0-beta.40f818c
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/AuthServer.js +2 -4
- 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/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.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/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 +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/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 +11 -11
|
@@ -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 PowerAppsCommand from '../../../base/PowerAppsCommand.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 PaEnvironmentGetCommand extends PowerAppsCommand {
|
|
15
13
|
get name() {
|
|
16
14
|
return commands.ENVIRONMENT_GET;
|
|
@@ -24,7 +22,7 @@ class PaEnvironmentGetCommand extends PowerAppsCommand {
|
|
|
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) {
|
|
@@ -2,7 +2,8 @@ import request from '../../../../request.js';
|
|
|
2
2
|
import PowerAppsCommand from '../../../base/PowerAppsCommand.js';
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
4
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
5
|
-
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export const options = z.strictObject({ ...globalOptionsZod.shape });
|
|
6
7
|
class PaEnvironmentListCommand extends PowerAppsCommand {
|
|
7
8
|
get name() {
|
|
8
9
|
return commands.ENVIRONMENT_LIST;
|
|
@@ -2,7 +2,7 @@ import { globalOptionsZod } from '../../../../Command.js';
|
|
|
2
2
|
import request from '../../../../request.js';
|
|
3
3
|
import PlannerCommand from '../../../base/PlannerCommand.js';
|
|
4
4
|
import commands from '../../commands.js';
|
|
5
|
-
const options = globalOptionsZod.strict();
|
|
5
|
+
export const options = globalOptionsZod.strict();
|
|
6
6
|
class PlannerTenantSettingsListCommand extends PlannerCommand {
|
|
7
7
|
get name() {
|
|
8
8
|
return commands.TENANT_SETTINGS_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 { formatting } from '../../../../utils/formatting.js';
|
|
5
|
-
import { zod } from '../../../../utils/zod.js';
|
|
6
5
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.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
11
|
asAdmin: z.boolean().optional()
|
|
13
|
-
})
|
|
14
|
-
.strict();
|
|
12
|
+
});
|
|
15
13
|
class PpEnvironmentGetCommand extends PowerPlatformCommand {
|
|
16
14
|
get name() {
|
|
17
15
|
return commands.ENVIRONMENT_GET;
|
|
@@ -25,7 +23,7 @@ class PpEnvironmentGetCommand extends PowerPlatformCommand {
|
|
|
25
23
|
getRefinedSchema(schema) {
|
|
26
24
|
return schema
|
|
27
25
|
.refine(options => !!options.name !== !!options.default, {
|
|
28
|
-
|
|
26
|
+
error: `Specify either name or default, but not both.`
|
|
29
27
|
});
|
|
30
28
|
}
|
|
31
29
|
async commandAction(logger, args) {
|
|
@@ -3,11 +3,10 @@ import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
-
const options =
|
|
7
|
-
.
|
|
6
|
+
export const options = z.strictObject({
|
|
7
|
+
...globalOptionsZod.shape,
|
|
8
8
|
asAdmin: z.boolean().optional()
|
|
9
|
-
})
|
|
10
|
-
.strict();
|
|
9
|
+
});
|
|
11
10
|
class PpEnvironmentListCommand extends PowerPlatformCommand {
|
|
12
11
|
get name() {
|
|
13
12
|
return commands.ENVIRONMENT_LIST;
|
|
@@ -2,7 +2,7 @@ import { globalOptionsZod } from '../../../../Command.js';
|
|
|
2
2
|
import request from '../../../../request.js';
|
|
3
3
|
import PowerBICommand from '../../../base/PowerBICommand.js';
|
|
4
4
|
import commands from '../../commands.js';
|
|
5
|
-
const options = globalOptionsZod.strict();
|
|
5
|
+
export const options = globalOptionsZod.strict();
|
|
6
6
|
class PpGatewayListCommand extends PowerBICommand {
|
|
7
7
|
get name() {
|
|
8
8
|
return commands.GATEWAY_LIST;
|
|
@@ -2,7 +2,7 @@ import { globalOptionsZod } from '../../../../Command.js';
|
|
|
2
2
|
import request from '../../../../request.js';
|
|
3
3
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
4
4
|
import commands from '../../commands.js';
|
|
5
|
-
const options = globalOptionsZod.strict();
|
|
5
|
+
export const options = globalOptionsZod.strict();
|
|
6
6
|
class PpTenantSettingsListCommand extends PowerPlatformCommand {
|
|
7
7
|
get name() {
|
|
8
8
|
return commands.TENANT_SETTINGS_LIST;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
2
|
import { powerPlatform } from '../../../../utils/powerPlatform.js';
|
|
3
3
|
import { validation } from '../../../../utils/validation.js';
|
|
4
|
-
import { zod } from '../../../../utils/zod.js';
|
|
5
4
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
6
5
|
import commands from '../../commands.js';
|
|
7
6
|
import { z } from 'zod';
|
|
8
|
-
const options =
|
|
9
|
-
.
|
|
10
|
-
url:
|
|
11
|
-
.refine(url => url === undefined || validation.isValidPowerPagesUrl(url) === true,
|
|
12
|
-
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
url: z.string().optional()
|
|
10
|
+
.refine(url => url === undefined || validation.isValidPowerPagesUrl(url) === true, {
|
|
11
|
+
error: e => `'${e.input}' is not a valid Power Pages URL.`
|
|
12
|
+
})
|
|
13
|
+
.alias('u'),
|
|
14
|
+
id: z.uuid().optional().alias('i'),
|
|
15
|
+
name: z.string().optional().alias('n'),
|
|
16
|
+
environmentName: z.string().alias('e')
|
|
17
|
+
});
|
|
18
18
|
class PpWebSiteGetCommand extends PowerPlatformCommand {
|
|
19
19
|
get name() {
|
|
20
20
|
return commands.WEBSITE_GET;
|
|
@@ -28,7 +28,7 @@ class PpWebSiteGetCommand extends PowerPlatformCommand {
|
|
|
28
28
|
getRefinedSchema(schema) {
|
|
29
29
|
return schema
|
|
30
30
|
.refine(options => [options.url, options.id, options.name].filter(x => x !== undefined).length === 1, {
|
|
31
|
-
|
|
31
|
+
error: `Specify either url, id or name, but not multiple.`
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
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 PurviewRetentionEventListCommand extends GraphCommand {
|
|
7
8
|
get name() {
|
|
8
9
|
return commands.RETENTIONEVENT_LIST;
|
|
@@ -2,7 +2,7 @@ import { globalOptionsZod } from '../../../../Command.js';
|
|
|
2
2
|
import { odata } from '../../../../utils/odata.js';
|
|
3
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
4
4
|
import commands from '../../commands.js';
|
|
5
|
-
const options = globalOptionsZod.strict();
|
|
5
|
+
export const options = globalOptionsZod.strict();
|
|
6
6
|
class PurviewRetentionEventTypeListCommand extends GraphCommand {
|
|
7
7
|
get name() {
|
|
8
8
|
return commands.RETENTIONEVENTTYPE_LIST;
|
|
@@ -2,7 +2,7 @@ import { globalOptionsZod } from '../../../../Command.js';
|
|
|
2
2
|
import { odata } from '../../../../utils/odata.js';
|
|
3
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
4
4
|
import commands from '../../commands.js';
|
|
5
|
-
const options = globalOptionsZod.strict();
|
|
5
|
+
export const options = globalOptionsZod.strict();
|
|
6
6
|
class PurviewRetentionLabelListCommand extends GraphCommand {
|
|
7
7
|
get name() {
|
|
8
8
|
return commands.RETENTIONLABEL_LIST;
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import commands from '../../commands.js';
|
|
5
4
|
import { validation } from '../../../../utils/validation.js';
|
|
6
5
|
import { spe } from '../../../../utils/spe.js';
|
|
7
6
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
11
|
-
name:
|
|
12
|
-
description:
|
|
13
|
-
containerTypeId: z.
|
|
14
|
-
.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
|
+
name: z.string().alias('n'),
|
|
11
|
+
description: z.string().optional().alias('d'),
|
|
12
|
+
containerTypeId: z.uuid().optional(),
|
|
17
13
|
containerTypeName: z.string().optional(),
|
|
18
14
|
ocrEnabled: z.boolean().optional(),
|
|
19
15
|
itemMajorVersionLimit: z.number()
|
|
20
|
-
.refine(numb => validation.isValidPositiveInteger(numb),
|
|
21
|
-
|
|
22
|
-
})
|
|
16
|
+
.refine(numb => validation.isValidPositiveInteger(numb), {
|
|
17
|
+
error: e => `'${e.input}' is not a valid positive integer.`
|
|
18
|
+
}).optional(),
|
|
23
19
|
itemVersioningEnabled: z.boolean().optional()
|
|
24
|
-
})
|
|
25
|
-
.strict();
|
|
20
|
+
});
|
|
26
21
|
class SpeContainerAddCommand extends GraphCommand {
|
|
27
22
|
get name() {
|
|
28
23
|
return commands.CONTAINER_ADD;
|
|
@@ -36,7 +31,7 @@ class SpeContainerAddCommand extends GraphCommand {
|
|
|
36
31
|
getRefinedSchema(schema) {
|
|
37
32
|
return schema
|
|
38
33
|
.refine((options) => [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 1, {
|
|
39
|
-
|
|
34
|
+
error: 'Use one of the following options: containerTypeId or containerTypeName.'
|
|
40
35
|
});
|
|
41
36
|
}
|
|
42
37
|
async commandAction(logger, args) {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { cli } from '../../../../cli/cli.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
7
6
|
import { odata } from '../../../../utils/odata.js';
|
|
8
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
|
-
const options =
|
|
10
|
-
.
|
|
11
|
-
containerId:
|
|
12
|
-
})
|
|
13
|
-
.strict();
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
containerId: z.string().alias('i')
|
|
11
|
+
});
|
|
14
12
|
class SpeContainerPermissionListCommand extends GraphCommand {
|
|
15
13
|
get name() {
|
|
16
14
|
return commands.CONTAINER_PERMISSION_LIST;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
|
-
import { validation } from '../../../../utils/validation.js';
|
|
5
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
6
5
|
import { spe } from '../../../../utils/spe.js';
|
|
7
6
|
import { odata } from '../../../../utils/odata.js';
|
|
8
|
-
const options =
|
|
9
|
-
.
|
|
10
|
-
containerTypeId: z.
|
|
11
|
-
.refine(id => validation.isValidGuid(id), id => ({
|
|
12
|
-
message: `'${id}' is not a valid GUID.`
|
|
13
|
-
})).optional(),
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
containerTypeId: z.uuid().optional(),
|
|
14
10
|
containerTypeName: z.string().optional()
|
|
15
|
-
})
|
|
16
|
-
.strict();
|
|
11
|
+
});
|
|
17
12
|
class SpeContainerRecycleBinItemListCommand extends GraphCommand {
|
|
18
13
|
get name() {
|
|
19
14
|
return commands.CONTAINER_RECYCLEBINITEM_LIST;
|
|
@@ -30,7 +25,7 @@ class SpeContainerRecycleBinItemListCommand extends GraphCommand {
|
|
|
30
25
|
getRefinedSchema(schema) {
|
|
31
26
|
return schema
|
|
32
27
|
.refine((options) => [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 1, {
|
|
33
|
-
|
|
28
|
+
error: 'Use one of the following options: containerTypeId or containerTypeName.'
|
|
34
29
|
});
|
|
35
30
|
}
|
|
36
31
|
async commandAction(logger, args) {
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
|
-
import { validation } from '../../../../utils/validation.js';
|
|
5
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
6
5
|
import { spe } from '../../../../utils/spe.js';
|
|
7
6
|
import { odata } from '../../../../utils/odata.js';
|
|
8
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
8
|
import { cli } from '../../../../cli/cli.js';
|
|
10
9
|
import request from '../../../../request.js';
|
|
11
|
-
const options =
|
|
12
|
-
.
|
|
13
|
-
containerTypeId: z.
|
|
14
|
-
.refine(id => validation.isValidGuid(id), id => ({
|
|
15
|
-
message: `'${id}' is not a valid GUID.`
|
|
16
|
-
})).optional(),
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
containerTypeId: z.uuid().optional(),
|
|
17
13
|
containerTypeName: z.string().optional(),
|
|
18
14
|
id: z.string().optional(),
|
|
19
15
|
name: z.string().optional()
|
|
20
|
-
})
|
|
21
|
-
.strict();
|
|
16
|
+
});
|
|
22
17
|
class SpeContainerRecycleBinItemRestoreCommand extends GraphCommand {
|
|
23
18
|
get name() {
|
|
24
19
|
return commands.CONTAINER_RECYCLEBINITEM_RESTORE;
|
|
@@ -32,13 +27,13 @@ class SpeContainerRecycleBinItemRestoreCommand extends GraphCommand {
|
|
|
32
27
|
getRefinedSchema(schema) {
|
|
33
28
|
return schema
|
|
34
29
|
.refine((options) => [options.id, options.name].filter(o => o !== undefined).length === 1, {
|
|
35
|
-
|
|
30
|
+
error: 'Use one of the following options: id or name.'
|
|
36
31
|
})
|
|
37
32
|
.refine((options) => !options.name || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 1, {
|
|
38
|
-
|
|
33
|
+
error: 'Use one of the following options when specifying the container name: containerTypeId or containerTypeName.'
|
|
39
34
|
})
|
|
40
35
|
.refine((options) => options.name || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 0, {
|
|
41
|
-
|
|
36
|
+
error: 'Options containerTypeId and containerTypeName are only required when restoring a container by name.'
|
|
42
37
|
});
|
|
43
38
|
}
|
|
44
39
|
async commandAction(logger, args) {
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import commands from '../../commands.js';
|
|
5
|
-
import { validation } from '../../../../utils/validation.js';
|
|
6
4
|
import { spe } from '../../../../utils/spe.js';
|
|
7
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
8
6
|
import request from '../../../../request.js';
|
|
9
7
|
import { cli } from '../../../../cli/cli.js';
|
|
10
|
-
const options =
|
|
11
|
-
.
|
|
12
|
-
id:
|
|
13
|
-
name:
|
|
14
|
-
containerTypeId: z.
|
|
15
|
-
.refine(id => validation.isValidGuid(id), id => ({
|
|
16
|
-
message: `'${id}' is not a valid GUID.`
|
|
17
|
-
})).optional(),
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
id: z.string().optional().alias('i'),
|
|
11
|
+
name: z.string().optional().alias('n'),
|
|
12
|
+
containerTypeId: z.uuid().optional(),
|
|
18
13
|
containerTypeName: z.string().optional(),
|
|
19
14
|
recycle: z.boolean().optional(),
|
|
20
|
-
force:
|
|
21
|
-
})
|
|
22
|
-
.strict();
|
|
15
|
+
force: z.boolean().optional().alias('f')
|
|
16
|
+
});
|
|
23
17
|
class SpeContainerRemoveCommand extends GraphCommand {
|
|
24
18
|
get name() {
|
|
25
19
|
return commands.CONTAINER_REMOVE;
|
|
@@ -33,13 +27,13 @@ class SpeContainerRemoveCommand extends GraphCommand {
|
|
|
33
27
|
getRefinedSchema(schema) {
|
|
34
28
|
return schema
|
|
35
29
|
.refine((options) => [options.id, options.name].filter(o => o !== undefined).length === 1, {
|
|
36
|
-
|
|
30
|
+
error: 'Use one of the following options: id or name.'
|
|
37
31
|
})
|
|
38
32
|
.refine((options) => !options.name || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 1, {
|
|
39
|
-
|
|
33
|
+
error: 'Use one of the following options when specifying the container name: containerTypeId or containerTypeName.'
|
|
40
34
|
})
|
|
41
35
|
.refine((options) => options.name || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 0, {
|
|
42
|
-
|
|
36
|
+
error: 'Options containerTypeId and containerTypeName are only required when deleting a container by name.'
|
|
43
37
|
});
|
|
44
38
|
}
|
|
45
39
|
async commandAction(logger, args) {
|
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import request from '../../../../request.js';
|
|
5
4
|
import { validation } from '../../../../utils/validation.js';
|
|
6
5
|
import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
|
|
7
6
|
import commands from '../../commands.js';
|
|
8
7
|
import Auth from '../../../../Auth.js';
|
|
9
8
|
const consumingTenantOverridablesOptions = ['urlTemplate', 'isDiscoverabilityEnabled', 'isSearchEnabled', 'isItemVersioningEnabled', 'itemMajorVersionLimit', 'maxStoragePerContainerInBytes'];
|
|
10
|
-
const options =
|
|
11
|
-
.
|
|
12
|
-
name:
|
|
13
|
-
appId: z.
|
|
14
|
-
.refine(id => validation.isValidGuid(id), id => ({
|
|
15
|
-
message: `'${id}' is not a valid GUID.`
|
|
16
|
-
})).optional(),
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
name: z.string().alias('n'),
|
|
12
|
+
appId: z.uuid().optional(),
|
|
17
13
|
billingType: z.enum(['standard', 'trial', 'directToCustomer']).default('standard'),
|
|
18
14
|
consumingTenantOverridables: z.string()
|
|
19
|
-
.refine(values => values.split(',').every(v => consumingTenantOverridablesOptions.includes(v.trim())),
|
|
20
|
-
|
|
21
|
-
})
|
|
15
|
+
.refine(values => values.split(',').every(v => consumingTenantOverridablesOptions.includes(v.trim())), {
|
|
16
|
+
error: e => `'${e.input}' is not a valid value. Valid options are: ${consumingTenantOverridablesOptions.join(', ')}.`
|
|
17
|
+
}).optional(),
|
|
22
18
|
isDiscoverabilityEnabled: z.boolean().optional(),
|
|
23
19
|
isItemVersioningEnabled: z.boolean().optional(),
|
|
24
20
|
isSearchEnabled: z.boolean().optional(),
|
|
25
21
|
isSharingRestricted: z.boolean().optional(),
|
|
26
22
|
itemMajorVersionLimit: z.number()
|
|
27
|
-
.refine(n => validation.isValidPositiveInteger(n),
|
|
28
|
-
|
|
29
|
-
})
|
|
23
|
+
.refine(n => validation.isValidPositiveInteger(n), {
|
|
24
|
+
error: e => `'${e.input}' is not a valid positive integer.`
|
|
25
|
+
}).optional(),
|
|
30
26
|
maxStoragePerContainerInBytes: z.number()
|
|
31
|
-
.refine(n => validation.isValidPositiveInteger(n),
|
|
32
|
-
|
|
33
|
-
})
|
|
27
|
+
.refine(n => validation.isValidPositiveInteger(n), {
|
|
28
|
+
error: e => `'${e.input}' is not a valid positive integer.`
|
|
29
|
+
}).optional(),
|
|
34
30
|
sharingCapability: z.enum(['disabled', 'externalUserSharingOnly', 'externalUserAndGuestSharing', 'existingExternalUserSharingOnly']).optional(),
|
|
35
31
|
urlTemplate: z.string().optional()
|
|
36
|
-
})
|
|
37
|
-
.strict();
|
|
32
|
+
});
|
|
38
33
|
class SpeContainerTypeAddCommand extends GraphDelegatedCommand {
|
|
39
34
|
get name() {
|
|
40
35
|
return commands.CONTAINERTYPE_ADD;
|
|
@@ -48,7 +43,7 @@ class SpeContainerTypeAddCommand extends GraphDelegatedCommand {
|
|
|
48
43
|
getRefinedSchema(schema) {
|
|
49
44
|
return schema
|
|
50
45
|
.refine(options => !options.itemMajorVersionLimit || options.isItemVersioningEnabled !== false, {
|
|
51
|
-
|
|
46
|
+
error: `Cannot set itemMajorVersionLimit when isItemVersioningEnabled is false.`
|
|
52
47
|
});
|
|
53
48
|
}
|
|
54
49
|
async commandAction(logger, args) {
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import { validation } from '../../../../utils/validation.js';
|
|
2
1
|
import commands from '../../commands.js';
|
|
3
2
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
3
|
import { z } from 'zod';
|
|
5
|
-
import { zod } from '../../../../utils/zod.js';
|
|
6
4
|
import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
|
|
7
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
6
|
import request from '../../../../request.js';
|
|
9
7
|
import { odata } from '../../../../utils/odata.js';
|
|
10
8
|
import { cli } from '../../../../cli/cli.js';
|
|
11
|
-
const options =
|
|
12
|
-
.
|
|
13
|
-
id:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}))
|
|
17
|
-
.optional()),
|
|
18
|
-
name: zod.alias('n', z.string().optional())
|
|
19
|
-
})
|
|
20
|
-
.strict();
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
id: z.uuid().optional().alias('i'),
|
|
12
|
+
name: z.string().optional().alias('n')
|
|
13
|
+
});
|
|
21
14
|
class SpeContainerTypeGetCommand extends GraphDelegatedCommand {
|
|
22
15
|
get name() {
|
|
23
16
|
return commands.CONTAINERTYPE_GET;
|
|
@@ -31,7 +24,7 @@ class SpeContainerTypeGetCommand extends GraphDelegatedCommand {
|
|
|
31
24
|
getRefinedSchema(schema) {
|
|
32
25
|
return schema
|
|
33
26
|
.refine(options => [options.id, options.name].filter(o => o !== undefined).length === 1, {
|
|
34
|
-
|
|
27
|
+
error: 'Use one of the following options: id or name.'
|
|
35
28
|
});
|
|
36
29
|
}
|
|
37
30
|
async commandAction(logger, args) {
|
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { zod } from '../../../../utils/zod.js';
|
|
4
3
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
5
4
|
import commands from '../../commands.js';
|
|
6
5
|
import { spo } from '../../../../utils/spo.js';
|
|
7
6
|
import { cli } from '../../../../cli/cli.js';
|
|
8
|
-
import { validation } from '../../../../utils/validation.js';
|
|
9
7
|
import request from '../../../../request.js';
|
|
10
8
|
import config from '../../../../config.js';
|
|
11
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
12
|
-
const options =
|
|
13
|
-
.
|
|
14
|
-
id:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.optional()),
|
|
19
|
-
name: zod.alias('n', z.string().optional()),
|
|
20
|
-
force: zod.alias('f', z.boolean().optional())
|
|
21
|
-
})
|
|
22
|
-
.strict();
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
id: z.uuid().optional().alias('i'),
|
|
13
|
+
name: z.string().optional().alias('n'),
|
|
14
|
+
force: z.boolean().optional().alias('f')
|
|
15
|
+
});
|
|
23
16
|
class SpeContainerTypeRemoveCommand extends SpoCommand {
|
|
24
17
|
get name() {
|
|
25
18
|
return commands.CONTAINERTYPE_REMOVE;
|
|
@@ -33,7 +26,7 @@ class SpeContainerTypeRemoveCommand extends SpoCommand {
|
|
|
33
26
|
getRefinedSchema(schema) {
|
|
34
27
|
return schema
|
|
35
28
|
.refine(options => [options.id, options.name].filter(o => o !== undefined).length === 1, {
|
|
36
|
-
|
|
29
|
+
error: 'Use one of the following options: id, name.'
|
|
37
30
|
});
|
|
38
31
|
}
|
|
39
32
|
async commandAction(logger, args) {
|
|
@@ -7,19 +7,17 @@ import { z } from 'zod';
|
|
|
7
7
|
import { CommandError, globalOptionsZod } from '../../../../Command.js';
|
|
8
8
|
import { fsUtil } from '../../../../utils/fsUtil.js';
|
|
9
9
|
import { packageManager } from '../../../../utils/packageManager.js';
|
|
10
|
-
import { zod } from '../../../../utils/zod.js';
|
|
11
10
|
import commands from '../../commands.js';
|
|
12
11
|
import { BaseProjectCommand } from './base-project-command.js';
|
|
13
12
|
import { FN017001_MISC_npm_dedupe } from './project-upgrade/rules/FN017001_MISC_npm_dedupe.js';
|
|
14
|
-
const options =
|
|
15
|
-
.
|
|
13
|
+
export const options = z.strictObject({
|
|
14
|
+
...globalOptionsZod.shape,
|
|
16
15
|
packageManager: z.enum(['npm', 'pnpm', 'yarn']).default('npm'),
|
|
17
16
|
preview: z.boolean().optional(),
|
|
18
|
-
toVersion:
|
|
17
|
+
toVersion: z.string().optional().alias('v'),
|
|
19
18
|
shell: z.enum(['bash', 'powershell', 'cmd']).default('powershell'),
|
|
20
19
|
output: z.enum(['json', 'text', 'md', 'tour', 'csv', 'none']).optional()
|
|
21
|
-
})
|
|
22
|
-
.strict();
|
|
20
|
+
});
|
|
23
21
|
class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
24
22
|
get name() {
|
|
25
23
|
return commands.PROJECT_UPGRADE;
|
|
@@ -2,26 +2,22 @@ import commands from '../../commands.js';
|
|
|
2
2
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
3
3
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { zod } from '../../../../utils/zod.js';
|
|
6
5
|
import { validation } from '../../../../utils/validation.js';
|
|
7
6
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
9
|
import { odata } from '../../../../utils/odata.js';
|
|
11
|
-
export const options =
|
|
12
|
-
.
|
|
13
|
-
webUrl:
|
|
14
|
-
.refine(url => validation.isValidSharePointUrl(url) === true,
|
|
15
|
-
|
|
16
|
-
})
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
webUrl: 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('u'),
|
|
17
17
|
fileUrl: z.string().optional(),
|
|
18
|
-
fileId:
|
|
19
|
-
.refine(id => validation.isValidGuid(id), id => ({
|
|
20
|
-
message: `'${id}' is not a valid GUID.`
|
|
21
|
-
})).optional()),
|
|
18
|
+
fileId: z.uuid().optional().alias('i'),
|
|
22
19
|
label: z.string()
|
|
23
|
-
})
|
|
24
|
-
.strict();
|
|
20
|
+
});
|
|
25
21
|
class SpoFileVersionKeepCommand extends SpoCommand {
|
|
26
22
|
get name() {
|
|
27
23
|
return commands.FILE_VERSION_KEEP;
|
|
@@ -35,7 +31,7 @@ class SpoFileVersionKeepCommand extends SpoCommand {
|
|
|
35
31
|
getRefinedSchema(schema) {
|
|
36
32
|
return schema
|
|
37
33
|
.refine(options => [options.fileUrl, options.fileId].filter(o => o !== undefined).length === 1, {
|
|
38
|
-
|
|
34
|
+
error: `Specify 'fileUrl' or 'fileId', but not both.`
|
|
39
35
|
});
|
|
40
36
|
}
|
|
41
37
|
async commandAction(logger, args) {
|