@pnp/cli-microsoft365 11.4.0-beta.13d597c → 11.4.0-beta.37c2235
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devproxy/api-specs/sharepoint.yaml +43 -0
- package/README.md +1 -1
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +1 -1
- package/dist/AuthServer.js +2 -4
- package/dist/Command.js +2 -2
- package/dist/cli/cli.js +9 -9
- package/dist/m365/adaptivecard/commands/adaptivecard-send.js +10 -11
- package/dist/m365/app/commands/app-open.js +3 -4
- package/dist/m365/app/commands/permission/permission-add.js +4 -5
- package/dist/m365/base/AppCommand.js +3 -3
- package/dist/m365/booking/commands/business/business-get.js +6 -8
- package/dist/m365/booking/commands/business/business-list.js +2 -1
- package/dist/m365/cli/commands/app/app-add.js +5 -7
- package/dist/m365/commands/docs.js +1 -1
- package/dist/m365/commands/login.js +22 -19
- package/dist/m365/commands/logout.js +1 -1
- package/dist/m365/commands/status.js +2 -1
- package/dist/m365/connection/commands/connection-list.js +2 -1
- package/dist/m365/connection/commands/connection-set.js +15 -29
- package/dist/m365/context/commands/context-remove.js +4 -6
- package/dist/m365/context/commands/option/option-remove.js +5 -7
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-add.js +5 -7
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +7 -9
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +4 -5
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-remove.js +8 -10
- package/dist/m365/entra/commands/license/license-list.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-remove.js +1 -1
- package/dist/m365/entra/commands/multitenant/multitenant-add.js +3 -4
- package/dist/m365/entra/commands/organization/organization-list.js +4 -6
- package/dist/m365/entra/commands/organization/organization-set.js +24 -26
- package/dist/m365/entra/commands/roleassignment/roleassignment-add.js +21 -34
- package/dist/m365/entra/commands/roledefinition/roledefinition-add.js +8 -10
- package/dist/m365/entra/commands/roledefinition/roledefinition-get.js +11 -13
- package/dist/m365/entra/commands/roledefinition/roledefinition-list.js +5 -7
- package/dist/m365/entra/commands/roledefinition/roledefinition-remove.js +11 -13
- package/dist/m365/entra/commands/roledefinition/roledefinition-set.js +15 -17
- package/dist/m365/entra/commands/rolepermission/rolepermission-list.js +5 -7
- package/dist/m365/entra/commands/user/user-session-revoke.js +9 -13
- package/dist/m365/exo/commands/approleassignment/approleassignment-add.js +29 -31
- package/dist/m365/flow/commands/environment/environment-get.js +5 -7
- package/dist/m365/flow/commands/environment/environment-list.js +2 -1
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-list.js +4 -6
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-restore.js +5 -11
- package/dist/m365/graph/commands/directoryextension/directoryextension-add.js +11 -13
- package/dist/m365/graph/commands/directoryextension/directoryextension-get.js +10 -19
- package/dist/m365/graph/commands/directoryextension/directoryextension-list.js +6 -12
- package/dist/m365/graph/commands/directoryextension/directoryextension-remove.js +11 -20
- package/dist/m365/graph/commands/openextension/openextension-add.js +12 -13
- package/dist/m365/graph/commands/openextension/openextension-get.js +12 -14
- package/dist/m365/graph/commands/openextension/openextension-list.js +11 -13
- package/dist/m365/graph/commands/openextension/openextension-remove.js +13 -15
- package/dist/m365/graph/commands/openextension/openextension-set.js +16 -17
- package/dist/m365/onedrive/commands/onedrive-list.js +2 -1
- package/dist/m365/outlook/commands/mail/mail-searchfolder-add.js +9 -14
- package/dist/m365/outlook/commands/mailbox/mailbox-settings-get.js +8 -12
- package/dist/m365/outlook/commands/mailbox/mailbox-settings-set.js +15 -15
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +2 -1
- package/dist/m365/pa/commands/environment/environment-get.js +5 -7
- package/dist/m365/pa/commands/environment/environment-list.js +2 -1
- package/dist/m365/planner/commands/tenant/tenant-settings-list.js +1 -1
- package/dist/m365/pp/commands/environment/environment-get.js +5 -7
- package/dist/m365/pp/commands/environment/environment-list.js +3 -4
- package/dist/m365/pp/commands/gateway/gateway-list.js +1 -1
- package/dist/m365/pp/commands/tenant/tenant-settings-list.js +1 -1
- package/dist/m365/pp/commands/website/website-get.js +12 -12
- package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +2 -1
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +1 -1
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +1 -1
- package/dist/m365/spe/commands/container/container-add.js +10 -15
- package/dist/m365/spe/commands/container/container-permission-list.js +4 -6
- package/dist/m365/spe/commands/container/container-recyclebinitem-list.js +5 -10
- package/dist/m365/spe/commands/container/container-recyclebinitem-remove.js +96 -0
- 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/spe/commands.js +1 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +4 -6
- package/dist/m365/spo/commands/file/file-add.js +49 -11
- package/dist/m365/spo/commands/file/file-version-keep.js +10 -14
- package/dist/m365/spo/commands/homesite/homesite-add.js +13 -15
- package/dist/m365/spo/commands/homesite/homesite-get.js +8 -9
- package/dist/m365/spo/commands/homesite/homesite-remove.js +9 -10
- package/dist/m365/spo/commands/homesite/homesite-set.js +13 -14
- package/dist/m365/spo/commands/list/DefaultColumnValue.js +2 -0
- package/dist/m365/spo/commands/list/list-defaultvalue-clear.js +13 -17
- package/dist/m365/spo/commands/list/list-defaultvalue-get.js +124 -0
- package/dist/m365/spo/commands/list/list-defaultvalue-list.js +13 -37
- package/dist/m365/spo/commands/list/list-defaultvalue-remove.js +12 -16
- package/dist/m365/spo/commands/list/list-defaultvalue-set.js +11 -15
- package/dist/m365/spo/commands/list/list-view-add.js +16 -20
- package/dist/m365/spo/commands/listitem/listitem-set.js +1 -1
- package/dist/m365/spo/commands/page/page-control-remove.js +11 -15
- package/dist/m365/spo/commands/page/page-get.js +10 -11
- package/dist/m365/spo/commands/page/page-header-set.js +97 -89
- package/dist/m365/spo/commands/page/page-publish.js +9 -10
- package/dist/m365/spo/commands/page/page-section-remove.js +11 -12
- package/dist/m365/spo/commands/page/page-set.js +26 -26
- package/dist/m365/spo/commands/site/site-appcatalog-list.js +4 -6
- package/dist/m365/spo/commands/site/site-get.js +6 -8
- package/dist/m365/spo/commands/site/site-sharingpermission-set.js +7 -9
- package/dist/m365/spo/commands/site/site-versionpolicy-get.js +11 -13
- package/dist/m365/spo/commands/web/web-alert-list.js +20 -27
- package/dist/m365/spo/commands/web/web-alert-remove.js +15 -20
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/spp/commands/model/model-apply.js +18 -24
- package/dist/m365/teams/commands/callrecord/callrecord-list.js +5 -9
- package/dist/m365/teams/commands/chat/chat-message-list.js +26 -27
- package/dist/m365/teams/commands/chat/chat-message-send.js +12 -3
- package/dist/m365/teams/commands/chat/chatUtil.js +1 -1
- package/dist/m365/tenant/commands/people/people-pronouns-set.js +4 -6
- package/dist/m365/tenant/commands/report/report-settings-set.js +4 -6
- package/dist/m365/viva/commands/engage/engage-community-user-add.js +17 -22
- package/dist/m365/viva/commands/engage/engage-community-user-list.js +8 -14
- package/dist/m365/viva/commands/engage/engage-community-user-remove.js +14 -22
- package/dist/m365/viva/commands/engage/engage-role-member-list.js +6 -11
- package/dist/utils/spo.js +30 -2
- package/dist/utils/zod.js +41 -76
- package/docs/docs/cmd/entra/app/app-permission-add.mdx +19 -0
- package/docs/docs/cmd/entra/app/app-permission-list.mdx +19 -0
- package/docs/docs/cmd/entra/app/app-permission-remove.mdx +21 -0
- package/docs/docs/cmd/spe/container/container-recyclebinitem-remove.mdx +79 -0
- package/docs/docs/cmd/spo/file/file-add.mdx +140 -1
- package/docs/docs/cmd/spo/list/list-defaultvalue-get.mdx +118 -0
- package/docs/docs/cmd/spo/page/page-header-set.mdx +28 -8
- package/docs/docs/cmd/spo/page/page-set.mdx +35 -5
- package/docs/docs/cmd/teams/chat/chat-message-list.mdx +34 -7
- package/docs/docs/cmd/teams/chat/chat-message-send.mdx +23 -1
- package/npm-shrinkwrap.json +274 -248
- package/package.json +12 -11
|
@@ -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;
|
|
@@ -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) {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
5
|
+
import { spe } from '../../../../utils/spe.js';
|
|
6
|
+
import { odata } from '../../../../utils/odata.js';
|
|
7
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
8
|
+
import { cli } from '../../../../cli/cli.js';
|
|
9
|
+
import request from '../../../../request.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
id: z.string().optional().alias('i'),
|
|
13
|
+
name: z.string().optional().alias('n'),
|
|
14
|
+
containerTypeId: z.uuid().optional(),
|
|
15
|
+
containerTypeName: z.string().optional(),
|
|
16
|
+
force: z.boolean().optional().alias('f')
|
|
17
|
+
});
|
|
18
|
+
class SpeContainerRecycleBinItemRemoveCommand extends GraphCommand {
|
|
19
|
+
get name() {
|
|
20
|
+
return commands.CONTAINER_RECYCLEBINITEM_REMOVE;
|
|
21
|
+
}
|
|
22
|
+
get description() {
|
|
23
|
+
return 'Permanently removes a container from the recycle bin';
|
|
24
|
+
}
|
|
25
|
+
get schema() {
|
|
26
|
+
return options;
|
|
27
|
+
}
|
|
28
|
+
getRefinedSchema(schema) {
|
|
29
|
+
return schema
|
|
30
|
+
.refine((options) => [options.id, options.name].filter(o => o !== undefined).length === 1, {
|
|
31
|
+
error: 'Use one of the following options: id or name.'
|
|
32
|
+
})
|
|
33
|
+
.refine((options) => !options.name || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 1, {
|
|
34
|
+
error: 'Use one of the following options when specifying the container name: containerTypeId or containerTypeName.'
|
|
35
|
+
})
|
|
36
|
+
.refine((options) => options.name || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 0, {
|
|
37
|
+
error: 'Options containerTypeId and containerTypeName are only required when removing a container by name.'
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async commandAction(logger, args) {
|
|
41
|
+
if (!args.options.force) {
|
|
42
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to permanently remove deleted container '${args.options.id || args.options.name}'?` });
|
|
43
|
+
if (!result) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const containerId = await this.getContainerId(args.options, logger);
|
|
49
|
+
if (this.verbose) {
|
|
50
|
+
await logger.logToStderr(`Permanently removing deleted container with ID '${containerId}'...`);
|
|
51
|
+
}
|
|
52
|
+
const requestOptions = {
|
|
53
|
+
url: `${this.resource}/v1.0/storage/fileStorage/deletedContainers/${containerId}`,
|
|
54
|
+
headers: {
|
|
55
|
+
accept: 'application/json;odata.metadata=none'
|
|
56
|
+
},
|
|
57
|
+
responseType: 'json'
|
|
58
|
+
};
|
|
59
|
+
await request.delete(requestOptions);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
this.handleRejectedODataJsonPromise(err);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async getContainerId(options, logger) {
|
|
66
|
+
if (options.id) {
|
|
67
|
+
return options.id;
|
|
68
|
+
}
|
|
69
|
+
if (this.verbose) {
|
|
70
|
+
await logger.logToStderr(`Retrieving container with name '${options.name}'...`);
|
|
71
|
+
}
|
|
72
|
+
const containerTypeId = await this.getContainerTypeId(options, logger);
|
|
73
|
+
const containers = await odata.getAllItems(`${this.resource}/v1.0/storage/fileStorage/deletedContainers?$filter=containerTypeId eq ${containerTypeId}&$select=id,displayName`);
|
|
74
|
+
const matchingContainers = containers.filter(c => c.displayName.toLowerCase() === options.name.toLowerCase());
|
|
75
|
+
if (matchingContainers.length === 0) {
|
|
76
|
+
throw new Error(`The specified container '${options.name}' does not exist.`);
|
|
77
|
+
}
|
|
78
|
+
if (matchingContainers.length > 1) {
|
|
79
|
+
const containerKeyValuePair = formatting.convertArrayToHashTable('id', matchingContainers);
|
|
80
|
+
const container = await cli.handleMultipleResultsFound(`Multiple containers with name '${options.name}' found.`, containerKeyValuePair);
|
|
81
|
+
return container.id;
|
|
82
|
+
}
|
|
83
|
+
return matchingContainers[0].id;
|
|
84
|
+
}
|
|
85
|
+
async getContainerTypeId(options, logger) {
|
|
86
|
+
if (options.containerTypeId) {
|
|
87
|
+
return options.containerTypeId;
|
|
88
|
+
}
|
|
89
|
+
if (this.verbose) {
|
|
90
|
+
await logger.logToStderr(`Getting container type with name '${options.containerTypeName}'...`);
|
|
91
|
+
}
|
|
92
|
+
return spe.getContainerTypeIdByName(options.containerTypeName);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export default new SpeContainerRecycleBinItemRemoveCommand();
|
|
96
|
+
//# sourceMappingURL=container-recyclebinitem-remove.js.map
|
|
@@ -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) {
|